Compare commits

...

178 Commits

Author SHA1 Message Date
Alex Deucher
fe5c46546e r600: disable compressed texture support
It's not implemented yet.  fixes fdo bug 24047
2009-11-18 11:51:20 -05:00
Alex Deucher
c5add6a468 docs: Add note about r600 2009-11-18 11:32:55 -05:00
Alex Deucher
13b5a624b1 Revert "radeon: Fix legacy bo not to reuse dma buffers before refcount is 1."
This reverts commit 284a7af274.

This breaks kde desktop effects.  See fdo bug 24131
2009-11-18 11:27:36 -05:00
Brian Paul
027abddf4f mesa: set version string to 7.6.1-rc1 2009-11-18 08:08:25 -07:00
Brian Paul
d449c07b8b xorg/st: fixup builds against later dpms headers.
(cherry picked from master, commit e9d6ab72be)
2009-11-18 08:07:56 -07:00
Brian Paul
2b3ea2be90 docs: i965 clipping fix 2009-11-17 15:53:27 -07:00
Eric Anholt
514544f373 i965: Fix Ironlake shadow comparisons.
The cube map array index arg is always present.
2009-11-12 11:41:39 -08:00
Eric Anholt
5f305b1db9 i965: Fix VBO last-valid-offset setup on Ironlake.
Instead of doing math based on the (broken for VBO && offset != 0)
input->count number, just use the BO size.  Fixes assertion failure in ETQW.
2009-11-12 11:41:39 -08:00
Roland Scheidegger
ab12e764ba i965: fix EXT_provoking_vertex support
This didn't work for quad/quadstrips at all, and for all other primitive types
it only worked when they were unclipped.
Fix up the former in gs stage (could probably do without these changes and
instead set QuadsFollowProvokingVertexConvention to false), and the rest in
clip stage.
2009-11-11 17:57:56 -08:00
Eric Anholt
1220aba99b i965: Fix VS constant buffer value loading.
Previously, we'd load linearly from ParameterValues[0] for the constants,
though ParameterValues[1] may not equal ParameterValues[0] + 4.  Additionally,
the STATE_VAL type paramters didn't get updated.

Fixes piglit vp-constant-array-huge.vpfp and ET:QW object locations.

Bug #23226.
2009-11-10 14:44:40 -08:00
Eric Anholt
e5ffb9f5ea i965: Unalias src/dst registers for SGE and friends.
Fixes piglit vp-sge-alias test, and the googleearth ground shader.  \o/

Bug #22228
(cherry picked from commit 56ab92bad8)
2009-11-10 14:44:39 -08:00
Eric Anholt
23a4a6727e i965: Allow use of PROGRAM_LOCAL constants in ARB_vp.
Fixes piglit arl.vp.
(cherry picked from commit d52d78b4bc)
2009-11-10 14:44:39 -08:00
Alex Deucher
74ef3207d8 r600: don't emit htile regs
These are needed for HiZ which is not currently used and
the _BASE reg requires a reloc which is not currently supported
in the drm.
2009-11-09 12:27:27 -05:00
Ian Romanick
2cda507fa1 prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV 2009-11-07 15:54:33 -08:00
Ian Romanick
6d2ceda780 prog parse: Handle GL_VERTEX_PROGRAM_NV in glProgramStringARB
Handle both NV vertex programs and NV vertex state programs passed to
glProgramStringARB.
2009-11-07 15:54:33 -08:00
Ian Romanick
289db82b2d prog parse: Handle GL_FRAGMENT_PROGRAM_ARB in glLoadProgramNV 2009-11-07 15:54:32 -08:00
Ian Romanick
7452877cf6 prog parse: Handle GL_FRAGMENT_PROGRAM_NV in glProgramStringARB 2009-11-07 15:54:32 -08:00
Ian Romanick
26d2ce0a09 GLX: Change GLX client vendor string to "Mesa Project and SGI"
This change allows a certain closed-source browser plug-in to work
with open-source drivers.
2009-11-06 14:52:49 -08:00
Ian Romanick
9348ac03ce ARB prog parser: Regenerate parser from previous commits. 2009-11-06 10:46:23 -08:00
Ian Romanick
d8e256f923 ARB prog parser: Release old program string in _mesa_parse_arb_{fragment,vertex}_program
The program structure passed to _mesa_parse_arb_program is just a
place holder.  The stings that actually need to be released are only
known to the functions calling _mesa_parse_arb_program, so they should
be freed there.
2009-11-06 10:46:22 -08:00
Ian Romanick
301a9b7e28 ARB prog parser: Release strings returned from the lexer that don't need to be kept 2009-11-06 10:46:22 -08:00
Ian Romanick
1c7337d46e Revert "ARB prog parser: Fix epic memory leak in lexer / parser interface"
This reverts commit 93dae6761b.

This change was completely broken when the parser uses multiple
strings in a single production.  It would be nice if bug fixes could
initially land somewhere other than the stable branch.
2009-11-06 10:46:22 -08:00
Brian Paul
63191bd244 xmesa: pass pixmap to clip_for_xgetimage()
The code was assuming ctx->DrawBuffer == ctx->ReadBuffer.
Passing the pixmap is simpler and better.
Fixes a potential segfault.
2009-11-05 16:48:52 -07:00
Brian Paul
7c623905bc mesa: added cast to silence warning 2009-11-04 17:58:43 -07:00
Brian Paul
1c3f7ab74c vbo: fix out-of-bounds array access
The exec->vtx.inputs[] array was being written past its end.  This was
clobbering the following vbo_exec_context::eval state.  Probably not noticed
since evaluators and immediate mode rendering don't happen at the same time.

Fixed the loop in vbo_exec_vtx_init().
Changed the size of the vbo_exec_context::vtx.arrays[] array.
Added a bunch of debug-build assertions.

Issue found by Vinson Lee.
2009-11-04 17:51:28 -07:00
Brian Paul
bc4ad7c2ae mesa: fix broken pack_histogram() case for GLhalf 2009-11-04 17:42:30 -07:00
Brian Paul
76aa0c0fd3 mesa: silence warning from gcc 4.4.1 2009-11-04 17:42:01 -07:00
Vinson Lee
60c328db2d progs/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-04 15:56:14 -07:00
Alan Hourihane
f1b91ccc08 Fix YTILE spantmp functions 2009-11-04 15:26:38 +00:00
Vinson Lee
51f7763c00 glslcompiler: Fix Mac OS build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-04 07:14:55 -07:00
Brian Paul
6eb71519f7 mesa: (GLint64) casts in get.c to silence Visual Studio warnings
Revised version of a patch from Karl Schultz.
2009-11-03 16:13:24 -07:00
Brian Paul
c5106339d3 docs: fix 7.6 build with Visual Studio 2009-11-03 16:12:02 -07:00
Karl Schultz
804d367a47 windows: updated VC8 project file
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:09:29 -07:00
Karl Schultz
077eb0d81c windows: remove old entrypoints from mesa.def file
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:08:46 -07:00
Karl Schultz
e713a95c96 mesa: added GLAPIENTRY keywords for sync object functions
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 16:05:12 -07:00
Marek Olšák
a0cd2b7029 st/mesa: clip pixels in draw_stencil_pixels to avoid crash
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 09:48:04 -07:00
Brian Paul
e60ebebb39 st/mesa: don't use util_blit_pixels_writemask() for depth or depth/stencil
util_blit_pixels_writemask() only works for color formats at this time.
Also, it might never work for depth/stencil surfaces since we can't get
handle stencil values in a fragment shader.

Fixes glCopyTexSubImage(GL_DEPTH_COMPONENT).
2009-11-03 09:48:04 -07:00
Brian Paul
0197348641 st/mesa: fix tests for depth and depth/stencil texture formats 2009-11-03 09:48:04 -07:00
Vinson Lee
e055665752 glx: Fix memory leak if XF86DRICreateDrawable() fails
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-02 12:35:47 -07:00
Chow Loong Jin
35506dec67 Add --with-dri-searchpath argument
* Add an extra argument to configure which allows for specifying
  different DRI driver search paths to libGL (FDO #24766)

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-10-30 06:00:13 -07:00
Brian Paul
02b9fb9c80 progs/tests: fixes for drawbuffers.c
Disable GL_DEPTH_TEST before glDrawPixels.
Show color buffer 0 on left, color buffer 1 on right.
2009-10-29 14:46:35 -06:00
Brian Paul
635ea87374 progs/tests: added test for GL_EXT_texture_compression_s3tc support 2009-10-28 21:50:51 -06:00
Vinson Lee
96128fdf2f mesa: Fix memory leak if we run out of memory
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 17:59:49 -06:00
Vinson Lee
c0a61c8442 intel: Fix memory leak in case of renderbuffer bad format
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 13:09:44 -06:00
Brian Paul
0219cd0961 mesa: remove unneeded #includes 2009-10-28 11:13:21 -06:00
Brian Paul
5e3b2baae7 mesa: include imports.h to silence warning 2009-10-28 11:11:30 -06:00
Vinson Lee
a7d0665c00 intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-28 11:10:14 -06:00
Ian Romanick
93dae6761b ARB prog parser: Fix epic memory leak in lexer / parser interface
Anything that matched IDENTIFIER was strdup'ed and returned to the
parser.  However, almost every case of IDENTIFIER in the parser just
dropped the returned string on the floor.  Every swizzle string, every
option string, every use of a variable, etc. leaked memory.

Create a temporary buffer in the parser state (string_dumpster and
dumpster_size).  Return strings from the lexer to the parser in the
buffer.  Grow the buffer as needed.  When the parser needs to keep a
string (i.e., delcaring a new variable), let it make a copy then.

The only leak that valgrind now detects is /occasionally/ the copy of
the program string in gl_program::String is leaked.  I'm not seeing
how. :(
2009-10-27 17:06:18 -07:00
Ian Romanick
8df9587d68 ARB prog parser: Don't leak program string
The program string is kept in the program object.  On the second call
into glProgramStringARB the previous kept string would be leaked.
2009-10-27 17:06:18 -07:00
Ian Romanick
0f255d1956 ARB prog parser: Don't leak symbol table header structures 2009-10-27 17:06:18 -07:00
Eric Anholt
2643a7ba29 intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS).
Bug #24435
(cherry picked from commit d56125a298)
2009-10-27 16:59:03 -07:00
Brian Paul
b7eea8c616 intel: added region draw_x/y offsets in x/y_tile_swizzle() funcs
This fixes the second part of bug 23552.
2009-10-27 17:35:30 -06:00
Brian Paul
498fcfd315 progs/tests: added new blitfb.c test
Tests glBlitFramebuffer() between two texture/renderbuffer surfaces.
In particular, blit from level[1] of a cube map face to a 2D texture.

Used to find/fix bug in intel do_copy_texsubimage().
See commit aef1ab1073f3e30d699b99dae17518ed48b57c72
2009-10-27 16:46:20 -06:00
Brian Paul
22575abdec intel: fix src offset bug in do_copy_texsubimage()
Use src->draw_offset intead of zero.  Zero usually worked, except when
the src renderbuffer is actually a texture mipmap level higher than zero.
Fixes progs/test/blitfb.c test.
2009-10-27 16:46:20 -06:00
Brian Paul
517ae7a3b6 glsl: fix memory leak
A slightly modified version of a patch from Vinson Lee.
2009-10-27 16:29:15 -06:00
Eric Anholt
70b17db918 i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
2009-10-27 10:27:15 -07:00
Brian Paul
43dc91f8bb i965: be clear that the Fallback field is a boolean, not a bitfield 2009-10-27 09:31:53 -06:00
Brian Paul
f9e334cb32 Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()"
This reverts commit 8810b8f671.

It turns out the i965 driver uses the intel->Fallback field as a boolean,
not as a bitmask.  The intelFallback() function is a no-op in the i965
driver.  It would have been nice if there were some comments about this.
I'll fix that next...
2009-10-27 09:31:53 -06:00
Vinson Lee
42732611d3 draw: Fix memory leak.
This would only be hit if we got and invalid index_size.
2009-10-27 09:14:29 -06:00
Brian Paul
0a47631849 docs: document Intel glBitmap fixes 2009-10-26 10:58:47 -06:00
Brian Paul
48dad9c93f intel: fix GL state bugs in intel_texture_bitmap()
Need to push texture state and polygon state too.
Fixes rendering glitches seen in progs/demos/engine when changing
the rendering mode (wireframe, texture modes).
This makes bitmap rendering a little slower, unfortunately.
2009-10-26 10:44:22 -06:00
Brian Paul
dc8b139aa2 mesa: remove FBO texture depth/stencil test
The texture format should not be checked until validation time since
the format might be changed by a subsequent glTexImage() call.
2009-10-23 18:22:41 -06:00
Brian Paul
0acb057ad1 mesa: fix broken _mesa_str_checksum() 2009-10-23 16:36:15 -06:00
Eric Anholt
2d17dbfb53 intel: Keep track of x,y offsets in miptrees and use them for blitting.
By just using offsets, we confused the hardware's tiling calculations,
resulting in failures in miptree validation and blit clears.

Fixes piglit fbo-clearmipmap.

Bug #23552. (automatic mipmap generation)
2009-10-23 14:12:24 -07:00
Brian Paul
b01937a3c9 progs/tests: print requested/internal format info 2009-10-23 14:52:10 -06:00
Brian Paul
96d7d66dff docs: document updated GL extension header files 2009-10-23 14:49:47 -06:00
Brian Paul
5c0dc902e7 gl: updated wglext.h to version 17 2009-10-23 14:49:26 -06:00
Brian Paul
559da98c2b gl: updated glxext.h to version 25 2009-10-23 14:49:26 -06:00
Brian Paul
9df9696f6d gl: updated glext.h to version 56 2009-10-23 14:49:20 -06:00
Brian Paul
ff3f09a7fe docs: document cell, glGetTexLevelParameter() fixes 2009-10-23 14:45:44 -06:00
Brian Paul
cd62b4f00a mesa: fix GL_TEXTURE_INTERNAL_FORMAT query for compressed formats
Need to return the actual compressed format when the user originally
requested a generic compressed format.
2009-10-23 14:45:44 -06:00
Brian Paul
9528dc6ed8 mesa: added _mesa_compressed_format_to_glenum()
Maps a compressed MESA_FORMAT_x to correspding GLenum.  Needed for
querying a texture's actual format when a generic format was originally
requested.
2009-10-23 14:45:44 -06:00
Brian Paul
5e4f5e41a4 mesa: change s3tc vs. fxt1 priority when choosing compressed formats 2009-10-23 14:45:44 -06:00
Ian Romanick
dd24501665 ARB prog parser: Fix parameter array size comparison
Array indexes are invalid when >= the maximum, but array sizes are
only in valid when > the maximum.  This prevented programs from
declaring a single maximum size array.

See the piglit vp-max-array test.
2009-10-22 19:20:15 -07:00
Brian Paul
55058652b8 intel: flush old context before binding new context
Per the GLX spec, when changing rendering contexts, the old context
should first be flushed.
2009-10-22 18:33:26 -06:00
Brian Paul
5e6a6a2719 glx: don't destroy context immediately if it's currently bound
According to the GLXDestroyContext() man page, the context should not
immediately be destroyed if it's bound to some thread.  Wait until it's
unbound to really delete it.  The code for doing the later part is
already present in MakeContextCurrent() so no change was needed there.
2009-10-22 18:20:28 -06:00
Brian Paul
4837e01bcd mesa: code refactoring- new _mesa_finish(), _mesa_flush() 2009-10-22 18:16:10 -06:00
Brian Paul
61a96a2ac7 progs/xdemos: fix command line flag typo 2009-10-22 17:11:59 -06:00
Brian Paul
8810b8f671 i965: fix hacked Fallback usage in brw_prepare_vertices()
Setting intel->Fallback = 1 clobbered any fallback state that was already
set.  Not sure where this hack originated (the git history is a little
convoluted).  Define and use a new BRW_FALLBACK_DRAW bit instead.  This
shouldn't break anything and could potentially fix some bugs (but no
specific ones are known).
2009-10-22 16:52:59 -06:00
Brian Paul
c24466c34e intel: define INTEL_FALLBACK_DRIVER for drivers 2009-10-22 16:52:59 -06:00
Brian Paul
ea659f8917 intel: Fallback field is a bitmask, use GLbitfield 2009-10-22 16:52:59 -06:00
Brian Paul
f9bbbe5803 i965: remove unused brw_context::tmp_fallback field 2009-10-22 16:52:59 -06:00
Brian Paul
2f7abf5c04 i965: remove unused BRW_FALLBACK_TEXTURE bit
The value was probably wrong too.
It was the same as INTEL_FALLBACK_DRAW_BUFFER.
2009-10-22 16:52:59 -06:00
Andre Maasikas
869e20bcb7 r600: set barrier for tex inst if dst is used earlier, might overwrite it otherwise 2009-10-22 09:45:11 +03:00
Andre Maasikas
a88c9296cb r600: need to export something from PS
Also avoids empty shader for "END" - seems to be somewhat valid fp
 Maybe this can be done differently in the future (fake FRAG_RESULT_COLOR
 already in Map_Fragment_Program() or is there a way to program the chip
 to not hang in case of no exports.
2009-10-22 09:44:03 +03:00
Andre Maasikas
b86302283b r600: add beginnings of ARL instruction 2009-10-22 09:42:42 +03:00
Brian Paul
5283a3fb25 progs/trivial: check if GL_ARB_occlusion_query is supported 2009-10-20 16:22:03 -06:00
Marc Dietrich
4b2cf92ad9 cell: fix compilation on cell
s/LERP/LRP/
2009-10-20 11:17:12 -06:00
Vinson Lee
ca940a73a7 mesa: Fix Mac OS build.
strtod_l needs the xlocale.h header on Mac OS. It's possible other
non-Linux OSes would need this header too.
2009-10-20 10:43:49 -06:00
Mathias Fröhlich
16e21191e2 r300: fix texture size handling with size > 2048
The in kernel texture check fails because of both
bit11 flags being set on 16x16 textures. It tuns out
that these bits are still set and not cleared in the
pp_txpitch field of the texture. The attached patch
at least helps for this case on my machine. It clears
the bit 11 from the pitch field if the texture is smaller
and masks out that hight bits on the conventional width
and height field.

Fixes bug 24584
2009-10-19 11:47:21 -04:00
Robert Noland
8123180ea6 r600: Fix size calculation for 24 bit depth
size was being calculated based on 3 bytes per pixel with 24 bit depth
instead of 4 bytes.  This caused corruption in the bottom 25% of objects.
This finishes fixing the menu/text corruption in compiz/kde4.

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-19 11:09:10 -04:00
Maciej Cencora
3594b53c01 r300: fix vertex program parameters limits 2009-10-16 20:21:17 +02:00
Brian Paul
946bc9aa42 docs: document GLSL float parsing bug fix 2009-10-16 07:38:39 -06:00
Brian Paul
89b31c9619 mesa: use C locale for _mesa_strtod()
_mesa_strtod() is used for shader/program parsing where the decimal
point character is always '.'  Use strtod_l() with a "C" locale to
ensure correct string->double conversion when the actual locale uses
another character such as ',' for the decimal point.

Fixes bug 24531.
2009-10-16 07:36:50 -06:00
Owen Taylor
3f30b0709b Use the right pitch when rendering to a texture
We need to get the pitch from the texture level we are rendering to,
rather than just using the base texel width.
2009-10-15 11:33:08 -04:00
Robert Noland
16c6a3b71e r600: FRAG_ATTRIB_WPOS and FRAG_ATTRIB_FOGC appear to be supported.
Report unsupported attributes while I'm here.

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:52 -04:00
Robert Noland
a176b1c5d8 r600: cleanup in r600_cs_process_relocs().
Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:45 -04:00
Robert Noland
e5d6450c2c radeon: return EINVAL for 0 length buffers.
Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-15 11:29:35 -04:00
Andre Maasikas
22a0029a68 r600: fix tfp1 bo size
Setting the wrong bo size resulting in an incomplete
read cache flush when reading the texture.  This fixes the
compiz text corruption.

[agd5f: take hw pitch alignment into account]
2009-10-15 11:24:49 -04:00
Andre Maasikas
a3fec14101 r600: implement ProgramStringNotify
need this to properly test with piglit/glean vert/fragprog tests
copied mostly from r300, many thanks to osiris, nha, airlied, others...
2009-10-15 11:22:18 -04:00
Andre Maasikas
606becc7f3 r600: LIT dst.y gets value from src.x
seems I overlooked this when removing hardcoded swizzles for this
one previously
2009-10-15 11:21:15 -04:00
Andre Maasikas
74c31e5d05 r600: DPH adds w comp of second operand, so set first one to 1 instead 2009-10-15 11:20:04 -04:00
Andre Maasikas
95851d8cb2 r600: fixup KIL instruction a bit
- KILLGT takes 2 arguments
- arb KIL has no dst register
- add TODO about clause ending but currently piglit fp-kil passes and
  does not hang the card
2009-10-15 11:18:53 -04:00
Andre Maasikas
bf68e54a4d r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask
makes blend functions work better

Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-15 11:17:09 -04:00
Andre Maasikas
5101215a64 r600: user correct alpha blend factor
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-15 11:16:53 -04:00
Andre Maasikas
f7285bdffc r600: clear position enable bit when when wpos is not used by FP
Makes doom3 alot nicer..
2009-10-15 11:16:41 -04:00
Brian Paul
6f8b4d9e36 mesa: regenerated lex.yy.c w/ _mesa_strtod() 2009-10-15 08:59:13 -06:00
Neil Roberts
269f16cd96 mesa: Use _mesa_strtod in the lexer for assembly shaders
See bug 24531.
2009-10-15 08:57:07 -06:00
Brian Paul
31f7e8efb2 progs/Makefile: remove extra quoting
This reverts part of commit 115edf24a9 and
fixes the error: "/bin/sh: line 0: test: too many arguments".
2009-10-14 09:37:53 -06:00
Tom Fogal
115edf24a9 Fix build when PROGRAM_DIRS is empty.
SUBDIRS just takes PROGRAM_DIRS value.  If PROGRAM_DIRS gets set
to the empty string (as can happen when building only OSMesa), a
'for' loop will lack anything to iterate over, causing a parse
error.

This fixes the issue by making sure SUBDIRS is the null string
when PROGRAM_DIRS is, and wrapping the for loops in if's, causing
them only to execute if there are directories to iterate over.
2009-10-13 16:22:09 -06:00
Tom Fogal
9282edfaa0 ac: Fix AIX shared library builds.
AIX uses ".a" for both static and shared library extensions.
2009-10-13 16:22:06 -06:00
Eric Anholt
f3be27c0cf i965: Fix the last valid address setting for the index buffer.
Again, last valid address, not first invalid address.  Fixes regression
in 255e5be265 that the kernel now catches
and caused piglit draw_elements_base_vertex to fail.
2009-10-11 11:21:03 -07:00
Eric Anholt
a82da7fa26 i965: Fix the bounds emitted in the vertex buffer packets.
It's the address of the last valid byte, not the address of the first
invalid byte.

This should also fix problems with rendering with the new sanity checks in
the kernel.
2009-10-11 11:21:03 -07:00
Brian Paul
768481ed40 softpipe: revert 564df9dc5f
This change silenced valgrind warnings but broke progs/tests/drawbuffers.
The problem is we don't know the surface's state when we start caching it
(it may or may not be initialized/cleared/etc).  So "clearing" it here was
presumptuous.  Leaving the code in place (but disabled) for reference and
when using valgrind.

Fixes bug 24401
2009-10-10 09:18:14 -06:00
Alex Deucher
194ede4bf9 radeon: fix scissor regression
fixes fdo bug 24248
2009-10-09 15:44:32 -04:00
Brian Paul
2738681e84 docs: fix aux buffer bug 24426 2009-10-09 13:23:07 -06:00
Brian Paul
6164f1fe79 st/mesa: create aux buffers according to visual
Fixes bug 24426 for gallium.
2009-10-09 13:22:15 -06:00
Brian Paul
ce64e063a8 mesa: fix incorrect assertion in _mesa_add_aux_renderbuffers()
Fixes bug 24426.
2009-10-09 13:22:00 -06:00
Brian Paul
f7fb30f03b mesa: regenerated gl_mangle.h file 2009-10-08 09:19:42 -06:00
Brian Paul
ee3fbe7067 gallium/xlib: call XQueryExtension() in glXQueryExtension()
See bug 24321.
2009-10-07 14:43:27 -06:00
Brian Paul
9f002e4aaa mesa/xlib: call XQueryExtension() in glXQueryExtension()
See bug 24321.
2009-10-07 14:42:16 -06:00
Brian Paul
7dd2c0afd6 mesa: don't need to free textures, VBOs, etc. in _mesa_meta_free()
They're freed by the normal context deallocation code.
Fixes Blender crash, bug 24185.
2009-10-07 14:07:49 -06:00
Nicolai Hähnle
9fde81bb20 shader_api: Fix bounds checking of glUniform and glUniformMatrix
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-10-07 20:36:23 +02:00
Nicolai Hähnle
ae351599f1 prog_parameter: Document the fact that Size may be > 4
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-07 20:33:55 +02:00
Brian Paul
cdcd9da480 docs: fix glXQueryDrawable() bugs 2009-10-07 09:41:38 -06:00
Brian Paul
c3eef6021a mesa/xlib: fix glXQueryDrawable() bugs, see bug 24320 2009-10-07 09:41:38 -06:00
Brian Paul
0526100a5c gallium/xlib: fix glXQueryDrawable() bugs, see bug 24320 2009-10-07 09:41:38 -06:00
Brian Paul
f36425b569 progs/xdemos: test glXQueryDrawable() 2009-10-07 09:41:38 -06:00
Brian Paul
846a6b0695 progs/xdemos: fix swapped parameters to CreatePbuffer() 2009-10-07 09:41:38 -06:00
Brian Paul
edbaa717b4 swrast: s/GLfloat/GLuint/ in bzero() 2009-10-07 08:07:53 -06:00
Brian Paul
14f21c7850 swrast: add missing returns 2009-10-07 08:05:28 -06:00
Vinson Lee
4b3cbecb3a progs/test: Fix MSVC build. 2009-10-07 07:54:31 -06:00
Brian Paul
e3fff3daf0 mesa/xlib: return 0 for errorBase, eventBase in glXQueryExtension()
A little better than leaving the values undefined, I think.
See bug 24321.
2009-10-07 07:45:59 -06:00
Brian Paul
f9904edf53 gallium/xlib: return 0 for errorBase, eventBase in glXQueryExtension()
A little better than leaving the values undefined, I think.
See bug 24321.
2009-10-07 07:45:59 -06:00
Brian Paul
79892e7976 intel: use driReadDrawable in do_copy_texsubimage() 2009-10-05 14:26:16 -06:00
Brian Paul
3b7ec94c0d intel: use driReadDrawable, not driDrawable in do_blit_readpixels() 2009-10-05 14:25:36 -06:00
Brian Paul
3b29dcbb5e intel: remove a buffer equality test in _mesa_make_current()
Before, if we called glXMakeCurrent() to change a context's window binding
while an FBO was bound, we weren't updating the intel->driDrawable and
intel->driReadDrawable fields.  This could cause us to dereference a null
pointer elsewhere.
2009-10-05 14:07:29 -06:00
Brian Paul
a8768bbc9d mesa: fix return value when clipping {Read,Draw}Pixels height <= 0
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

(cherry picked from master, commit 7aeaca33c3)
2009-10-05 11:10:31 -06:00
Jon TURNEY
a15d9ca9cc Fix building of GLSL demos which use M_PI
Some <math.h> files do not define M_PI, in which case, provide our own definition

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-10-05 11:07:23 -06:00
Michel Dänzer
43750f1575 Use _mesa_select_tex_image() rather than hardcoding face 0.
Fixes crash loading a map in sauerbraten with

hwmipmap 1

in ~/.sauerbraten/config.cfg.
2009-10-05 12:31:51 +02:00
Frederic Crozat
3856c3cc46 r200: remove subpixel offset from viewport
Fixes bug fdo 20340 for r200.
2009-10-04 17:50:16 -04:00
Nicolai Hähnle
bbe384c86a r300: Workaround problem on R500 with very large fragment programs
The non-KMS interface is to blame here. In theory, a proper fix
could be produced that works for the KMS interface only, but it
require cleaning a lot of mess. Easier to just do it right in r300g.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 01:39:13 +02:00
Brian Paul
c01a77d304 docs: document default texture binding fix 2009-10-02 09:58:16 -06:00
Brian Paul
e1bddd159f mesa: fix incorrect default texture binding in unbind_texobj_from_texunits()
If we deleted a currently bound texture, we were always reverting the texture
binding to the default 1D texture rather than the proper default texture.
2009-10-02 09:57:00 -06:00
Brian Paul
85ee0ef9a7 gallium/xlib: use bitwise-and to test GLX_RGBA_BIT in choose_visual()
The parameter is a bitmask.
2009-10-02 07:52:29 -06:00
Brian Paul
584b0879ac xlib: use bitwise-and to test GLX_RGBA_BIT in choose_visual()
The parameter is a bitmask.
2009-10-02 07:51:19 -06:00
Brian Paul
abc12d0636 gallium/xlib: return GLX_RGBA_BIT or GLX_COLOR_INDEX_BIT in get_config()
This reverts part of commit a6b84aef4a
2009-10-02 07:47:49 -06:00
Brian Paul
389021220d gallium: replace // comments with /* */ 2009-10-02 07:31:42 -06:00
Brian Paul
337480e1f8 gallium: remove // comment and extra whitespace 2009-10-02 07:26:28 -06:00
Brian Paul
167ffa9e03 mesa: fix memory leak when generating mipmaps for compressed textures 2009-10-01 14:55:13 -06:00
Brian Paul
0574954238 mesa: fix mem leaks 2009-10-01 14:52:28 -06:00
Brian Paul
0f291f2efe gallium/util: silence uninitialized var warning 2009-10-01 14:52:10 -06:00
Brian Paul
63064cf7c3 mesa: add missing return when out of memory 2009-10-01 14:51:43 -06:00
Brian Paul
7b568614a2 mesa: fix potential uninitialized memory reads 2009-10-01 14:51:26 -06:00
Brian Paul
9b27a0d063 glsl: fix mem leak 2009-10-01 14:50:45 -06:00
Brian Paul
b3e41e0d5e st/mesa: check for null before asserts, fix possible mem leak 2009-10-01 14:49:39 -06:00
Brian Paul
b154497bef st/mesa: silence hidden parameter warning 2009-10-01 14:49:04 -06:00
Brian Paul
495628bc5c st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
(cherry picked from master, commit ae2daacbac)
2009-10-01 13:34:49 -06:00
Vinson Lee
18883cdf23 mesa: Return -FLT_MAX instead of 0 for LG2(0).
lim x->0 log(x) = -inf so -FLT_MAX is a better approximation than 0
for LG2(0).
2009-10-01 13:33:20 -06:00
Brian Paul
521e4b9b7e glx: fix glXQueryContext(GLX_RENDER_TYPE)
The renderType parameter to CreateContext() was never used.  Also, it
was often passed as zero.  Now when it's zero we check if the context
is RGBA or CI mode and set it accordingly.

Fixes bug 24211.
2009-09-30 15:15:10 -06:00
Eric Anholt
49fbdd18ed i965: Fix massive memory allocation for streaming texture usage.
Once we've freed a miptree, we won't see any more state cache requests
that would hit the things that pointed at it until we've let the miptree
get released back into the BO cache to be reused.  By leaving those
surface state and binding table pointers that pointed at it around, we
would end up with up to (500 * texture size) in memory uselessly consumed
by the state cache.

Bug #20057
Bug #23530
2009-09-30 11:27:27 -07:00
Brian Paul
b77469871a docs: document GLSL sqrt(0) fix 2009-09-29 19:05:04 -06:00
Brian Paul
322bc403bc glsl: regenerated file 2009-09-29 18:59:37 -06:00
Brian Paul
65765c9f2c glsl: rewrite sqrt(x) intrinsic to handle x=0
Since sqrt() is basically implemented in terms of RSQ/RCP we'll do a
divide by zero if x=0 and wind up with unpredictable results.
Now use CMP instruction to test for x<=0 and return zero in that case.
2009-09-29 18:57:13 -06:00
Brian Paul
3c794e45b0 glsl: add support for CMP instruction 2009-09-29 18:51:49 -06:00
Brian Paul
5f1faf4a21 docs: fixed glXQueryContext(GLX_RENDER_TYPE) 2009-09-29 12:18:41 -06:00
Brian Paul
a6b84aef4a gallium/xlib: fix GLX_RENDER_TYPE query
Return GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE.
2009-09-29 12:17:20 -06:00
Brian Paul
86ee448047 mesa/xlib: fix GLX_RENDER_TYPE query
Return GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE.
2009-09-29 12:16:20 -06:00
Brian Paul
ef9cd84521 glx: indentation fixes 2009-09-29 09:58:47 -06:00
Brian Paul
69a3043f41 mesa: bump version to 7.6.1 2009-09-29 09:36:06 -06:00
Brian Paul
2d400d43bf docs: initial 7.6.1 release notes 2009-09-29 09:34:47 -06:00
Brian Paul
9b5541617f mesa: work-around glXCopyContext() bug in _mesa_copy_texture_state()
See bug 24217.
2009-09-29 09:32:40 -06:00
Brian Paul
564df9dc5f softpipe: initialize the clear_flags bitvector in sp_create_tile_cache()
This silences tons of valgrind warnings in programs that don't call
glClear(), such as progs/demos/gamma.
2009-09-29 08:51:00 -06:00
Brian Paul
fbddc75aa2 softpipe: Grab a ref when the fb is set.
Nasty bug when the surface is freed and another is allocated right on
top of it. The next time we set the fb state SP thinks it's the same
surface and doesn't flush, and when the flush eventually happens the
surface belongs to a completely different texture.

(cherry picked from commit a77226071f)

Conflicts:
	src/gallium/drivers/softpipe/sp_context.c
2009-09-29 08:21:54 -06:00
Brian Paul
6829ef7460 docs: update news.html file with 7.5.2 and 7.6 release 2009-09-28 13:20:15 -06:00
Ian Romanick
d39fd9f641 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Conflicts:
	src/mesa/main/version.h
2009-09-28 12:02:39 -07:00
Ian Romanick
18f3afbe88 docs: 7.5.2 md5 sums 2009-09-28 11:41:23 -07:00
Ian Romanick
b807d49f18 Prep for 7.5.2 release 2009-09-28 11:33:52 -07:00
160 changed files with 2893 additions and 1476 deletions

View File

@@ -182,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.6
VERSION=7.6.1
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)

View File

@@ -124,7 +124,7 @@ INSTALL_INC_DIR = $(includedir)
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@

View File

@@ -10,7 +10,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=6
MESA_TINY=0
MESA_TINY=1
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.

View File

@@ -230,6 +230,8 @@ else
LIB_EXTENSION='dylib' ;;
cygwin* )
LIB_EXTENSION='dll' ;;
aix* )
LIB_EXTENSION='a' ;;
* )
LIB_EXTENSION='so' ;;
esac
@@ -647,6 +649,13 @@ AC_ARG_WITH([dri-driverdir],
[DRI_DRIVER_INSTALL_DIR="$withval"],
[DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
AC_SUBST([DRI_DRIVER_INSTALL_DIR])
dnl Extra search path for DRI drivers
AC_ARG_WITH([dri-searchpath],
[AS_HELP_STRING([--with-dri-searchpath=DIRS...],
[semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
[DRI_DRIVER_SEARCH_DIR="$withval"],
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
dnl Direct rendering or just indirect rendering
AC_ARG_ENABLE([driglx-direct],
[AS_HELP_STRING([--disable-driglx-direct],
@@ -1148,6 +1157,11 @@ yes)
if test "$tracker" = egl && test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
if test "$tracker" = xorg; then
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71"
HAVE_XEXTPROTO_71="no")
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
;;

View File

@@ -10,6 +10,17 @@
<H1>News</H1>
<h2>September 28, 2009</h2>
<p>
<a href="relnotes-7.6.html">Mesa 7.6</a> is released. This is a new feature
release. Those especially concerned about stability may want to wait for the
follow-on 7.6.1 bug-fix release.
</p>
<p>
<a href="relnotes-7.5.2.html">Mesa 7.5.2</a> is also released.
This is a stable release fixing bugs since the 7.5.1 release.
</p>
<h2>September 3, 2009</h2>
<p>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.5.2 Release Notes, (date tbd)</H1>
<H1>Mesa 7.5.2 Release Notes, 28 September 2009</H1>
<p>
Mesa 7.5.2 is a bug-fix release fixing issues found since the 7.5.1 release.
@@ -31,7 +31,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
43a90191dd9f76cd65dcc1ac91f3be70 MesaLib-7.5.2.tar.gz
94e47a499f1226803869c2e37a6a8e3a MesaLib-7.5.2.tar.bz2
1ecb822b567ad67a0617361d45206b67 MesaLib-7.5.2.zip
2718fdce7e075911d6147beb8f27104b MesaDemos-7.5.2.tar.gz
4e0f5ccd58afe21eddcd94327d926e86 MesaDemos-7.5.2.tar.bz2
f621f8c223b278d7c8e49a012d56ca25 MesaDemos-7.5.2.zip
83c16c1d6bcfcc3f97aab5d2fe430b4c MesaGLUT-7.5.2.tar.gz
e5d03bedae369ea3705783573bb33813 MesaGLUT-7.5.2.tar.bz2
e82ba28e00d653e6f437d32be8ca8481 MesaGLUT-7.5.2.zip
</pre>
@@ -55,6 +63,5 @@ tbd
when using Gallium.
</ul>
</body>
</html>

60
docs/relnotes-7.6.1.html Normal file
View File

@@ -0,0 +1,60 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.6.1 Release Notes, (date tbd)</H1>
<p>
Mesa 7.6.1 is a bug-fix release fixing issues since version 7.6.
</p>
<p>
Mesa 7.6.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>
tbd
</pre>
<h2>New features</h2>
<ul>
<li>Upgraded GL/glext.h to version 56, GL/glxext.h to version 25,
GL/wglext.h to version 17
<li>New 3D driver, r600, for Radeon R6xx, R7xx hardware
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
<li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
<li>GLSL sqrt(0) returned unpredictable results
<li>Fixed default texture binding bug when a bound texture was deleted.
<li>r300: Work around an issue with very large fragment programs on R500.
<li>Fake glXQueryDrawable() didn't return good values (bug 24320)
<li>Fixed AUX buffer breakage (bug 24426).
<li>Fixed locale-dependent float parsing bug in GLSL compiler (bug 24531)
<li>Fixed Gallium Cell driver compilation failure.
<li>Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that
it returns the actual compressed format chosen.
<li>Fixed glBitmap bugs in Intel drivers.
<li>Fixed a number of Microsoft Visual Studio compilation problems.
<li>Fixed clipping / provoking vertex bugs in i965 driver.
</ul>
</body>
</html>

View File

@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.6.1.html">7.6.1 release notes</A>
<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>
<LI><A HREF="relnotes-7.5.1.html">7.5.1 release notes</A>

View File

@@ -108,12 +108,20 @@
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendEquationi MANGLE(BlendEquationi)
#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
#define glBlendFunci MANGLE(BlendFunci)
#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
@@ -148,6 +156,7 @@
#define glClientActiveTexture MANGLE(ClientActiveTexture)
#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
#define glClientWaitSync MANGLE(ClientWaitSync)
#define glClipPlane MANGLE(ClipPlane)
#define glColor3b MANGLE(Color3b)
#define glColor3bv MANGLE(Color3bv)
@@ -320,6 +329,7 @@
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
@@ -341,6 +351,7 @@
#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
#define glDisable MANGLE(Disable)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexAttribAPPLE MANGLE(DisableVertexAttribAPPLE)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
@@ -354,7 +365,9 @@
#define glDrawBuffers MANGLE(DrawBuffers)
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
#define glDrawElementsInstanced MANGLE(DrawElementsInstanced)
#define glDrawElements MANGLE(DrawElements)
@@ -362,6 +375,7 @@
#define glDrawPixels MANGLE(DrawPixels)
#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
@@ -378,6 +392,7 @@
#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
#define glEnable MANGLE(Enable)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexAttribAPPLE MANGLE(EnableVertexAttribAPPLE)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
#define glEndConditionalRender MANGLE(EndConditionalRender)
@@ -409,6 +424,7 @@
#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
#define glFeedbackBuffer MANGLE(FeedbackBuffer)
#define glFenceSync MANGLE(FenceSync)
#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
@@ -469,9 +485,11 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
#define glFramebufferTexture MANGLE(FramebufferTexture)
#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY)
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
@@ -523,6 +541,7 @@
#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
#define glGetBooleani_v MANGLE(GetBooleani_v)
#define glGetBooleanv MANGLE(GetBooleanv)
#define glGetBufferParameteri64v MANGLE(GetBufferParameteri64v)
#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
@@ -586,6 +605,8 @@
#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
#define glGetInfoLogARB MANGLE(GetInfoLogARB)
#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
#define glGetInteger64i_v MANGLE(GetInteger64i_v)
#define glGetInteger64v MANGLE(GetInteger64v)
#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
#define glGetIntegeri_v MANGLE(GetIntegeri_v)
#define glGetIntegerv MANGLE(GetIntegerv)
@@ -615,6 +636,7 @@
#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
#define glGetMultisamplefv MANGLE(GetMultisamplefv)
#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV)
#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT)
#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT)
@@ -642,6 +664,7 @@
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
#define glGetObjectParameterivAPPLE MANGLE(GetObjectParameterivAPPLE)
#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
@@ -698,6 +721,7 @@
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
#define glGetTexEnvfv MANGLE(GetTexEnvfv)
@@ -715,6 +739,7 @@
#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv)
#define glGetTexParameteriv MANGLE(GetTexParameteriv)
#define glGetTexParameterPointervAPPLE MANGLE(GetTexParameterPointervAPPLE)
#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
@@ -825,12 +850,14 @@
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
#define glIsVertexArray MANGLE(IsVertexArray)
#define glIsVertexAttribEnabledAPPLE MANGLE(IsVertexAttribEnabledAPPLE)
#define glLightEnviSGIX MANGLE(LightEnviSGIX)
#define glLightf MANGLE(Lightf)
#define glLightfv MANGLE(Lightfv)
@@ -877,6 +904,10 @@
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
#define glMapVertexAttrib1dAPPLE MANGLE(MapVertexAttrib1dAPPLE)
#define glMapVertexAttrib1fAPPLE MANGLE(MapVertexAttrib1fAPPLE)
#define glMapVertexAttrib2dAPPLE MANGLE(MapVertexAttrib2dAPPLE)
#define glMapVertexAttrib2fAPPLE MANGLE(MapVertexAttrib2fAPPLE)
#define glMaterialf MANGLE(Materialf)
#define glMaterialfv MANGLE(Materialfv)
#define glMateriali MANGLE(Materiali)
@@ -907,9 +938,11 @@
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
#define glMultiDrawElementsBaseVertex MANGLE(MultiDrawElementsBaseVertex)
#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
#define glMultiDrawElements MANGLE(MultiDrawElements)
#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
@@ -1072,6 +1105,8 @@
#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
#define glNormalStream3sATI MANGLE(NormalStream3sATI)
#define glNormalStream3svATI MANGLE(NormalStream3svATI)
#define glObjectPurgeableAPPLE MANGLE(ObjectPurgeableAPPLE)
#define glObjectUnpurgeableAPPLE MANGLE(ObjectUnpurgeableAPPLE)
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
@@ -1162,6 +1197,7 @@
#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
#define glProgramParameteriARB MANGLE(ProgramParameteriARB)
#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
#define glProgramParameteri MANGLE(ProgramParameteri)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
@@ -1200,6 +1236,7 @@
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
#define glProvokingVertexEXT MANGLE(ProvokingVertexEXT)
#define glProvokingVertex MANGLE(ProvokingVertex)
#define glPushAttrib MANGLE(PushAttrib)
#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT)
#define glPushClientAttrib MANGLE(PushClientAttrib)
@@ -1283,6 +1320,7 @@
#define glSampleCoverage MANGLE(SampleCoverage)
#define glSampleMapATI MANGLE(SampleMapATI)
#define glSampleMaskEXT MANGLE(SampleMaskEXT)
#define glSampleMaski MANGLE(SampleMaski)
#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV)
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
@@ -1454,8 +1492,10 @@
#define glTexGeniv MANGLE(TexGeniv)
#define glTexImage1D MANGLE(TexImage1D)
#define glTexImage2D MANGLE(TexImage2D)
#define glTexImage2DMultisample MANGLE(TexImage2DMultisample)
#define glTexImage3DEXT MANGLE(TexImage3DEXT)
#define glTexImage3D MANGLE(TexImage3D)
#define glTexImage3DMultisample MANGLE(TexImage3DMultisample)
#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
#define glTexParameterf MANGLE(TexParameterf)
#define glTexParameterfv MANGLE(TexParameterfv)
@@ -1487,6 +1527,7 @@
#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
#define glTextureRangeAPPLE MANGLE(TextureRangeAPPLE)
#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
@@ -1828,6 +1869,7 @@
#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)
#define glWeightdvARB MANGLE(WeightdvARB)
#define glWeightfvARB MANGLE(WeightfvARB)

View File

@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2009-08-03 02:13:51 -0700 (Mon, 03 Aug 2009) $ */
/* glext.h last updated $Date: 2009-09-24 13:55:03 -0700 (Thu, 24 Sep 2009) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 54
#define GL_GLEXT_VERSION 56
/* Function declaration macros - to move into glplatform.h */
@@ -4236,7 +4236,7 @@ extern "C" {
#define GL_LUMINANCE16_SNORM 0x9019
#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
#define GL_INTENSITY16_SNORM 0x901B
/* reuse GL_R_SNORM */
/* reuse GL_RED_SNORM */
/* reuse GL_RG_SNORM */
/* reuse GL_RGB_SNORM */
/* reuse GL_RGBA_SNORM */
@@ -4311,6 +4311,88 @@ extern "C" {
#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
#endif
#ifndef GL_APPLE_rgb_422
#define GL_RGB_422_APPLE 0x8A1F
/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
#endif
#ifndef GL_NV_video_capture
#define GL_VIDEO_BUFFER_NV 0x9020
#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
#define GL_FIELD_UPPER_NV 0x9022
#define GL_FIELD_LOWER_NV 0x9023
#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
#define GL_PARTIAL_SUCCESS_NV 0x902E
#define GL_SUCCESS_NV 0x902F
#define GL_FAILURE_NV 0x9030
#define GL_YCBYCR8_422_NV 0x9031
#define GL_YCBAYCR8A_4224_NV 0x9032
#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
#endif
#ifndef GL_NV_copy_image
#endif
#ifndef GL_EXT_separate_shader_objects
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
#endif
#ifndef GL_NV_parameter_buffer_object2
#endif
#ifndef GL_NV_shader_buffer_load
#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
#define GL_GPU_ADDRESS_NV 0x8F34
#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
#endif
#ifndef GL_NV_vertex_buffer_unified_memory
#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
#endif
#ifndef GL_NV_texture_barrier
#endif
/*************************************************************/
@@ -9245,6 +9327,136 @@ typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType,
#define GL_APPLE_row_bytes 1
#endif
#ifndef GL_APPLE_rgb_422
#define GL_APPLE_rgb_422 1
#endif
#ifndef GL_NV_video_capture
#define GL_NV_video_capture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint);
GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint, GLuint, GLenum, GLintptrARB);
GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint, GLuint, GLenum, GLenum, GLuint);
GLAPI void APIENTRY glEndVideoCaptureNV (GLuint);
GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint, GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint, GLuint, GLenum, GLdouble *);
GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint, GLuint *, GLuint64EXT *);
GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint, GLuint, GLenum, const GLint *);
GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint, GLuint, GLenum, const GLfloat *);
GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint, GLuint, GLenum, const GLdouble *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
#endif
#ifndef GL_NV_copy_image
#define GL_NV_copy_image 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCopyImageSubDataNV (GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUseShaderProgramEXT (GLenum, GLuint);
GLAPI void APIENTRY glActiveProgramEXT (GLuint);
GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum, const GLchar *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
#endif
#ifndef GL_NV_parameter_buffer_object2
#define GL_NV_parameter_buffer_object2 1
#endif
#ifndef GL_NV_shader_buffer_load
#define GL_NV_shader_buffer_load 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMakeBufferResidentNV (GLenum, GLenum);
GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum);
GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum);
GLAPI void APIENTRY glNamedMakeBufferResidentNV (GLuint, GLenum);
GLAPI void APIENTRY glNamedMakeBufferNonResidentNV (GLuint);
GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint);
GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum, GLenum, GLuint64EXT *);
GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint, GLenum, GLuint64EXT *);
GLAPI void APIENTRY glGetIntegerui64vNV (GLenum, GLuint64EXT *);
GLAPI void APIENTRY glUniformui64NV (GLint, GLuint64EXT);
GLAPI void APIENTRY glUniformui64vNV (GLint, GLsizei, const GLuint64EXT *);
GLAPI void APIENTRY glGetUniformui64vNV (GLuint, GLint, GLuint64EXT *);
GLAPI void APIENTRY glProgramUniformui64NV (GLuint, GLint, GLuint64EXT);
GLAPI void APIENTRY glProgramUniformui64vNV (GLuint, GLint, GLsizei, const GLuint64EXT *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
typedef void (APIENTRYP PFNGLNAMEDMAKEBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
typedef void (APIENTRYP PFNGLNAMEDMAKEBUFFERNONRESIDENTNVPROC) (GLuint buffer);
typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
#ifndef GL_NV_vertex_buffer_unified_memory
#define GL_NV_vertex_buffer_unified_memory 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBufferAddressRangeNV (GLenum, GLuint, GLuint64EXT, GLsizeiptr);
GLAPI void APIENTRY glVertexFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glNormalFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glColorFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glIndexFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glTexCoordFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei);
GLAPI void APIENTRY glSecondaryColorFormatNV (GLint, GLenum, GLsizei);
GLAPI void APIENTRY glFogCoordFormatNV (GLenum, GLsizei);
GLAPI void APIENTRY glVertexAttribFormatNV (GLuint, GLint, GLenum, GLboolean, GLsizei);
GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint, GLint, GLenum, GLsizei);
GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum, GLuint, GLuint64EXT *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
#endif
#ifndef GL_NV_texture_barrier
#define GL_NV_texture_barrier 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTextureBarrierNV (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
#endif
#ifdef __cplusplus
}

View File

@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2009/08/03 */
/* glxext.h last updated 2009/10/08 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 23
#define GLX_GLXEXT_VERSION 25
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -382,6 +382,20 @@ extern "C" {
#ifndef GLX_NV_swap_group
#endif
#ifndef GLX_NV_video_capture
#define GLX_DEVICE_ID_NV 0x20CD
#define GLX_UNIQUE_ID_NV 0x20CE
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef GLX_EXT_swap_control
#define GLX_SWAP_INTERVAL_EXT 0x20F1
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
#endif
#ifndef GLX_NV_copy_image
#endif
/*************************************************************/
@@ -415,6 +429,14 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#ifndef GLX_NV_video_output
typedef unsigned int GLXVideoDeviceNV;
#endif
#ifndef GLX_NV_video_capture
typedef XID GLXVideoCaptureDeviceNV;
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
@@ -827,14 +849,80 @@ 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 *);
#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);
#endif
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
#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 *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#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);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
#endif
#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);
#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);
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
#endif
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalEXT (Display *, GLXDrawable, int);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
#endif
#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);
#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

View File

@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2009/08/03 */
/* wglext.h last updated 2009/09/16 */
/* Current version at http://www.opengl.org/registry/ */
#define WGL_WGLEXT_VERSION 15
#define WGL_WGLEXT_VERSION 17
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
@@ -388,6 +388,14 @@ extern "C" {
#define WGL_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef NV_video_capture
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef NV_copy_image
#endif
/*************************************************************/
@@ -400,7 +408,7 @@ DECLARE_HANDLE(HPBUFFEREXT);
#ifndef WGL_NV_present_video
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
#endif
#ifndef WGL_NV_video_out
#ifndef WGL_NV_video_output
DECLARE_HANDLE(HPVIDEODEV);
#endif
#ifndef WGL_NV_gpu_affinity
@@ -415,6 +423,9 @@ typedef struct _GPU_DEVICE {
RECT rcVirtualScreen;
} GPU_DEVICE, *PGPU_DEVICE;
#endif
#ifndef WGL_NV_video_capture
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
#endif
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
@@ -750,8 +761,8 @@ typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVide
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
#endif
#ifndef WGL_NV_video_out
#define WGL_NV_video_out 1
#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);
@@ -826,6 +837,30 @@ typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
#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);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif
#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);
#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
#ifdef __cplusplus
}

View File

@@ -15,18 +15,22 @@ message:
subdirs:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done \
fi
# Dummy install target
install:
clean:
-@for dir in $(SUBDIRS) tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done \
fi

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h>
#include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static char *FragProgFile = "skinning.frag";
static char *VertProgFile = "skinning.vert";

View File

@@ -14,6 +14,9 @@
#include <GL/glew.h>
#include <GL/glut.h>
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300;
static GLint win = 0;

View File

@@ -16,6 +16,9 @@
#include <GL/glut.h>
#include "shaderutil.h"
#ifndef M_PI
#define M_PI 3.1415926535
#endif
static GLint WinWidth = 300, WinHeight = 300;
static char *FragProgFile = NULL;

View File

@@ -28,6 +28,7 @@ SOURCES = \
blendminmax.c \
blendsquare.c \
blendxor.c \
blitfb.c \
bufferobj.c \
bumpmap.c \
bug_3050.c \

View File

@@ -52,6 +52,7 @@ progs = [
'blendminmax',
'blendsquare',
'blendxor',
'blitfb',
'bufferobj',
'bug_3050',
'bug_3101',

259
progs/tests/blitfb.c Normal file
View File

@@ -0,0 +1,259 @@
/**
* Test glFramebufferBlit()
* Brian Paul
* 27 Oct 2009
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
static int WinWidth = 1100, WinHeight = 600;
static int SrcWidth = 512, SrcHeight = 512;
static int DstWidth = 512, DstHeight = 512;
static GLuint SrcFB, DstFB;
static GLuint SrcTex, DstTex;
#if 0
static GLenum SrcTexTarget = GL_TEXTURE_2D, SrcTexFace = GL_TEXTURE_2D;
#else
static GLenum SrcTexTarget = GL_TEXTURE_CUBE_MAP, SrcTexFace = GL_TEXTURE_CUBE_MAP_POSITIVE_X;
#endif
static GLenum DstTexTarget = GL_TEXTURE_2D, DstTexFace = GL_TEXTURE_2D;
static GLuint SrcTexLevel = 01, DstTexLevel = 0;
static void
Draw(void)
{
GLboolean rp = GL_FALSE;
GLubyte *buf;
GLint srcWidth = SrcWidth >> SrcTexLevel;
GLint srcHeight = SrcHeight >> SrcTexLevel;
GLint dstWidth = DstWidth >> DstTexLevel;
GLint dstHeight = DstHeight >> DstTexLevel;
GLenum status;
/* clear window */
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
glClearColor(0.5, 0.5, 0.5, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
/* clear src buf */
glBindFramebufferEXT(GL_FRAMEBUFFER, SrcFB);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
assert(status == GL_FRAMEBUFFER_COMPLETE_EXT);
glClearColor(0, 1, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
/* clear dst buf */
glBindFramebufferEXT(GL_FRAMEBUFFER, DstFB);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
assert(status == GL_FRAMEBUFFER_COMPLETE_EXT);
glClearColor(1, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
/* blit src -> dst */
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, SrcFB);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, DstFB);
glBlitFramebufferEXT(0, 0, srcWidth, srcHeight,
0, 0, dstWidth, dstHeight,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
#if 01
/* read src results */
buf = malloc(4 * srcWidth * srcHeight);
memset(buf, 0x88, 4 * srcWidth * srcHeight);
glBindFramebufferEXT(GL_FRAMEBUFFER, SrcFB);
if (rp)
glReadPixels(0, 0, srcWidth, srcHeight, GL_RGBA, GL_UNSIGNED_BYTE, buf);
else {
glBindTexture(SrcTexTarget, SrcTex);
glGetTexImage(SrcTexFace, SrcTexLevel, GL_RGBA, GL_UNSIGNED_BYTE, buf);
}
/* draw dst in window */
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
glWindowPos2i(0, 0);
glDrawPixels(srcWidth, srcHeight, GL_RGBA, GL_UNSIGNED_BYTE, buf);
printf("Src Pix[0] = %d %d %d %d\n", buf[0], buf[1], buf[2], buf[3]);
free(buf);
#endif
glFinish();
/* read dst results */
buf = malloc(4 * dstWidth * dstHeight);
memset(buf, 0x88, 4 * dstWidth * dstHeight);
glBindFramebufferEXT(GL_FRAMEBUFFER, DstFB);
if (rp)
glReadPixels(0, 0, dstWidth, dstHeight, GL_RGBA, GL_UNSIGNED_BYTE, buf);
else {
glBindTexture(DstTexTarget, DstTex);
glGetTexImage(DstTexFace, DstTexLevel, GL_RGBA, GL_UNSIGNED_BYTE, buf);
}
/* draw dst in window */
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
glWindowPos2i(srcWidth + 2, 0);
glDrawPixels(dstWidth, dstHeight, GL_RGBA, GL_UNSIGNED_BYTE, buf);
printf("Dst Pix[0] = %d %d %d %d\n", buf[0], buf[1], buf[2], buf[3]);
free(buf);
glFinish();
glutSwapBuffers();
}
static void
Reshape(int width, int height)
{
WinWidth = width;
WinHeight = height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case 27:
glutDestroyWindow(Win);
exit(0);
break;
}
glutPostRedisplay();
}
static void
SpecialKey(int key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
}
glutPostRedisplay();
}
static void
InitFBOs(void)
{
GLuint w, h, lvl;
/* Src */
glGenTextures(1, &SrcTex);
glBindTexture(SrcTexTarget, SrcTex);
w = SrcWidth;
h = SrcHeight;
lvl = 0;
for (lvl = 0; ; lvl++) {
if (SrcTexTarget == GL_TEXTURE_CUBE_MAP) {
GLuint f;
for (f = 0; f < 6; f++) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, lvl, GL_RGBA8,
w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
}
else {
/* single face */
glTexImage2D(SrcTexFace, lvl, GL_RGBA8, w, h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
if (w == 1 && h == 1)
break;
if (w > 1)
w /= 2;
if (h > 1)
h /= 2;
}
glGenFramebuffersEXT(1, &SrcFB);
glBindFramebufferEXT(GL_FRAMEBUFFER, SrcFB);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
SrcTexFace, SrcTex, SrcTexLevel);
/* Dst */
glGenTextures(1, &DstTex);
glBindTexture(DstTexTarget, DstTex);
w = DstWidth;
h = DstHeight;
lvl = 0;
for (lvl = 0; ; lvl++) {
glTexImage2D(DstTexFace, lvl, GL_RGBA8, w, h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
if (w == 1 && h == 1)
break;
if (w > 1)
w /= 2;
if (h > 1)
h /= 2;
}
glGenFramebuffersEXT(1, &DstFB);
glBindFramebufferEXT(GL_FRAMEBUFFER, DstFB);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
DstTexFace, DstTex, DstTexLevel);
}
static void
Init(void)
{
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
fprintf(stderr, "This test requires GL_EXT_framebuffer_object\n");
exit(1);
}
if (!glutExtensionSupported("GL_EXT_framebuffer_blit")) {
fprintf(stderr, "This test requires GL_EXT_framebuffer_blit,\n");
exit(1);
}
InitFBOs();
printf("Left rect = src FBO, Right rect = dst FBO.\n");
printf("Both should be green.\n");
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
Init();
glutMainLoop();
return 0;
}

View File

@@ -43,6 +43,8 @@ Display(void)
glUseProgram_func(Program);
glEnable(GL_DEPTH_TEST);
/* draw to user framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBobject);
@@ -68,18 +70,23 @@ Display(void)
glPopMatrix();
/* read from user framebuffer */
/* bottom half = colorbuffer 0 */
/* left half = colorbuffer 0 */
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
glReadPixels(0, 0, Width, Height / 2, GL_RGBA, GL_UNSIGNED_BYTE,
glPixelStorei(GL_PACK_ROW_LENGTH, Width);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
glReadPixels(0, 0, Width / 2, Height, GL_RGBA, GL_UNSIGNED_BYTE,
buffer);
/* top half = colorbuffer 1 */
/* right half = colorbuffer 1 */
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
glReadPixels(0, Height/2, Width, Height - Height / 2,
glPixelStorei(GL_PACK_SKIP_PIXELS, Width / 2);
glReadPixels(Width / 2, 0, Width - Width / 2, Height,
GL_RGBA, GL_UNSIGNED_BYTE,
buffer + Width * (Height / 2) * 4);
buffer);
/* draw to window */
glUseProgram_func(0);
glDisable(GL_DEPTH_TEST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glWindowPos2iARB(0, 0);
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);

View File

@@ -285,6 +285,12 @@ main(int argc, char** argv)
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
glewInit();
if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
fprintf(stderr, "This test requires GL_EXT_texture_compression_s3tc.\n");
exit(1);
}
myInit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);

View File

@@ -257,11 +257,11 @@ RandomPrimitive(void)
Vcount++;
for (i = 0; i < len; i++) {
int k = RandomInt(9);
Vbuffer[Vcount].v[0] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[1] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[2] = RandomFloat(-3, 3);
Vbuffer[Vcount].v[3] = RandomFloat(-3, 3);
int k = RandomInt(9);
switch (k) {
case 0:
glVertex2fv(Vbuffer[Vcount].v);

View File

@@ -8,6 +8,10 @@
#include <GL/glew.h>
#include <GL/glut.h>
#ifndef APIENTRY
#define APIENTRY
#endif
static void assert_test(const char *file, int line, int cond, const char *msg)
{
if (!cond)
@@ -42,7 +46,7 @@ static void assert_error_test(const char *file, int line, GLenum expect)
#define assert_error(err) assert_error_test(__FILE__, __LINE__, (err))
static void check_status(GLuint id, GLenum pname, void (*query)(GLuint, GLenum, GLint *))
static void check_status(GLuint id, GLenum pname, void (APIENTRY *query)(GLuint, GLenum, GLint *))
{
GLint status;

View File

@@ -149,7 +149,7 @@ static void Reshape( int width, int height )
static void ReInit( GLenum TC, TEXTURE *Tx )
{
GLint rv;
GLint rv, v;
if ((Tx->TC == TC) && (Tx->cData != NULL)) {
glCompressedTexImage2DARB(GL_TEXTURE_2D, /* target */
@@ -170,6 +170,12 @@ static void ReInit( GLenum TC, TEXTURE *Tx )
GL_UNSIGNED_BYTE, /* texture type */
Tx->data); /* the texture */
v = 0;
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
GL_TEXTURE_INTERNAL_FORMAT, &v);
printf("Requested internal format = 0x%x, actual = 0x%x\n", TC, v);
/* okay, now cache the compressed texture */
Tx->TC = TC;
if (Tx->cData != NULL) {

View File

@@ -39,6 +39,11 @@ GLenum doubleBuffer;
static void Init(void)
{
if (!glutExtensionSupported("GL_ARB_occlusion_query")) {
fprintf(stderr, "Sorry, this program requires GL_ARB_occlusion_query\n");
exit(1);
}
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));

View File

@@ -95,7 +95,7 @@ enum sync_type {
static void usage(char *name)
{
printf("usage: %s [-w <width>] [-h <height>] [-s<sync method>] "
"[-vc]\n", name);
"[-v]\n", name);
printf("\t-s<sync method>:\n");
printf("\t\tn: none\n");
printf("\t\ts: SGI video sync extension\n");

View File

@@ -143,7 +143,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
/* Create the pbuffer using first fbConfig in the list that works. */
for (i=0;i<nConfigs;i++) {
pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, preserve, largest);
pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, largest, preserve);
if (pBuffer) {
gFBconfig = fbConfigs[i];
gWidth = width;
@@ -210,6 +210,21 @@ Setup(int width, int height)
return 0;
}
/* Test drawable queries */
{
unsigned int v;
glXQueryDrawable( gDpy, gPBuffer, GLX_WIDTH, &v);
printf("GLX_WIDTH = %u\n", v);
glXQueryDrawable( gDpy, gPBuffer, GLX_HEIGHT, &v);
printf("GLX_HEIGHT = %u\n", v);
glXQueryDrawable( gDpy, gPBuffer, GLX_PRESERVED_CONTENTS, &v);
printf("GLX_PRESERVED_CONTENTS = %u\n", v);
glXQueryDrawable( gDpy, gPBuffer, GLX_LARGEST_PBUFFER, &v);
printf("GLX_LARGEST_PBUFFER = %u\n", v);
glXQueryDrawable( gDpy, gPBuffer, GLX_FBCONFIG_ID, &v);
printf("GLX_FBCONFIG_ID = %u\n", v);
}
/* Get corresponding XVisualInfo */
visInfo = GetVisualFromFBConfig(gDpy, gScreen, gFBconfig);
if (!visInfo) {

View File

@@ -268,7 +268,7 @@ void cso_release_all( struct cso_context *ctx )
void cso_destroy_context( struct cso_context *ctx )
{
if (ctx) {
//cso_release_all( ctx );
/*cso_release_all( ctx );*/
FREE( ctx );
}
}

View File

@@ -212,17 +212,10 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
vs->prepare(vs, draw);
}
//return TRUE;
}
static void fse_run_linear( struct draw_pt_middle_end *middle,
unsigned start,
unsigned count )

View File

@@ -210,7 +210,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
pvs->run = post_vs_viewport;
}
else {
//if (opengl)
/* if (opengl) */
pvs->run = post_vs_cliptest_viewport_gl;
}
}

View File

@@ -394,6 +394,7 @@ vcache_check_run( struct draw_pt_front_end *frontend,
default:
assert(0);
FREE(storage);
return;
}
}
@@ -422,6 +423,7 @@ vcache_check_run( struct draw_pt_front_end *frontend,
default:
assert(0);
FREE(storage);
return;
}
}

View File

@@ -891,7 +891,7 @@ static void x87_emit_ex2( struct aos_compilation *cp )
struct x86_reg st1 = x86_make_reg(file_x87, 1);
int stack = cp->func->x87_stack;
// set_fpu_round_neg_inf( cp );
/* set_fpu_round_neg_inf( cp ); */
x87_fld(cp->func, st0); /* a a */
x87_fprndint( cp->func ); /* int(a) a*/
@@ -1759,14 +1759,14 @@ emit_instruction( struct aos_compilation *cp,
return emit_SUB(cp, inst);
case TGSI_OPCODE_LRP:
// return emit_LERP(cp, inst);
/*return emit_LERP(cp, inst);*/
return FALSE;
case TGSI_OPCODE_FRC:
return emit_FRC(cp, inst);
case TGSI_OPCODE_CLAMP:
// return emit_CLAMP(cp, inst);
/*return emit_CLAMP(cp, inst);*/
return FALSE;
case TGSI_OPCODE_FLR:

View File

@@ -584,7 +584,7 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
}
#ifdef DEBUG
//assert(!fenced_list->numUnfenced);
/*assert(!fenced_list->numUnfenced);*/
#endif
pipe_mutex_unlock(fenced_list->mutex);

View File

@@ -217,7 +217,7 @@ ATTRIB( R8G8_SNORM, 2, char, FROM_8_SNORM, TO_8_SNORM )
ATTRIB( R8_SNORM, 1, char, FROM_8_SNORM, TO_8_SNORM )
ATTRIB( A8R8G8B8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )
//ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )
/*ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )*/
ATTRIB( R32G32B32A32_FIXED, 4, int, FROM_32_FIXED, TO_32_FIXED )
ATTRIB( R32G32B32_FIXED, 3, int, FROM_32_FIXED, TO_32_FIXED )

View File

@@ -268,7 +268,7 @@ static void check_os_katmai_support(void)
* and therefore to be safe I'm going to leave this test in here.
*/
if (__cpu_detect_caps.hasSSE) {
// test_os_katmai_exception_support();
/* test_os_katmai_exception_support(); */
}
/* Restore the original signal handlers.

View File

@@ -254,7 +254,7 @@ debug_profile_start(void)
{
WCHAR *p;
// increment starting from the less significant digit
/* increment starting from the less significant digit */
p = &wFileName[14];
while(1) {
if(*p == '9') {

View File

@@ -214,7 +214,7 @@ debug_symbol_print_imagehlp(const void *addr)
HANDLE hProcess;
BYTE symbolBuffer[1024];
PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL) symbolBuffer;
DWORD dwDisplacement = 0; // Displacement of the input address, relative to the start of the symbol
DWORD dwDisplacement = 0; /* Displacement of the input address, relative to the start of the symbol */
hProcess = GetCurrentProcess();

View File

@@ -1427,6 +1427,7 @@ set_vertex_data(struct gen_mipmap_state *ctx,
rz = -1.0f;
break;
default:
rx = ry = rz = 0.0f;
assert(0);
}

View File

@@ -674,7 +674,7 @@ emit_MAD(struct codegen *gen, const struct tgsi_full_instruction *inst)
* Emit linear interpolate. See emit_ADD for comments.
*/
static boolean
emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
emit_LRP(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch, s1_reg[4], s2_reg[4], s3_reg[4], d_reg[4], tmp_reg[4];
@@ -1766,7 +1766,7 @@ emit_instruction(struct codegen *gen,
return emit_binop(gen, inst);
case TGSI_OPCODE_MAD:
return emit_MAD(gen, inst);
case TGSI_OPCODE_LERP:
case TGSI_OPCODE_LRP:
return emit_LRP(gen, inst);
case TGSI_OPCODE_DP3:
return emit_DP3(gen, inst);

View File

@@ -105,12 +105,17 @@ static void softpipe_destroy( struct pipe_context *pipe )
softpipe->quad[i].output->destroy( softpipe->quad[i].output );
}
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
}
sp_destroy_tile_cache(softpipe->zsbuf_cache);
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
sp_destroy_tile_cache(softpipe->tex_cache[i]);
pipe_texture_reference(&softpipe->texture[i], NULL);
}
for (i = 0; i < Elements(softpipe->constants); i++) {
if (softpipe->constants[i].buffer) {

View File

@@ -101,7 +101,7 @@ fs_sse_run( const struct sp_fragment_shader *base,
machine->Consts,
(const float (*)[4])shader->immediates,
machine->InterpCoefs
// , &machine->QuadPos
/*, &machine->QuadPos*/
);
return ~(machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0]);

View File

@@ -56,7 +56,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
sp_flush_tile_cache(sp, sp->cbuf_cache[i]);
/* assign new */
sp->framebuffer.cbufs[i] = fb->cbufs[i];
pipe_surface_reference(&sp->framebuffer.cbufs[i], fb->cbufs[i]);
/* update cache */
sp_tile_cache_set_surface(sp->cbuf_cache[i], fb->cbufs[i]);
@@ -71,7 +71,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
sp_flush_tile_cache(sp, sp->zsbuf_cache);
/* assign new */
sp->framebuffer.zsbuf = fb->zsbuf;
pipe_surface_reference(&sp->framebuffer.zsbuf, fb->zsbuf);
/* update cache */
sp_tile_cache_set_surface(sp->zsbuf_cache, fb->zsbuf);

View File

@@ -130,6 +130,16 @@ sp_create_tile_cache( struct pipe_screen *screen )
tc->entries[pos].x =
tc->entries[pos].y = -1;
}
/* XXX this code prevents valgrind warnings about use of uninitialized
* memory in programs that don't clear the surface before rendering.
* However, it breaks clearing in other situations (such as in
* progs/tests/drawbuffers, see bug 24402).
*/
#if 0 && TILE_CLEAR_OPTIMIZATION
/* set flags to indicate all the tiles are cleared */
memset(tc->clear_flags, 255, sizeof(tc->clear_flags));
#endif
}
return tc;
}

View File

@@ -850,10 +850,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
if (!fbConfig)
return NULL;
parselist++;
if (*parselist == GLX_RGBA_BIT) {
if (*parselist & GLX_RGBA_BIT) {
rgb_flag = GL_TRUE;
}
else if (*parselist == GLX_COLOR_INDEX_BIT) {
else if (*parselist & GLX_COLOR_INDEX_BIT) {
rgb_flag = GL_FALSE;
}
else if (*parselist == 0) {
@@ -1309,13 +1309,17 @@ glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
Bool
glXQueryExtension( Display *dpy, int *errorb, int *event )
glXQueryExtension( Display *dpy, int *errorBase, int *eventBase )
{
int op, ev, err;
/* Mesa's GLX isn't really an X extension but we try to act like one. */
(void) dpy;
(void) errorb;
(void) event;
return True;
if (!XQueryExtension(dpy, GLX_EXTENSION_NAME, &op, &ev, &err))
ev = err = 0;
if (errorBase)
*errorBase = err;
if (eventBase)
*eventBase = ev;
return True; /* we're faking GLX so always return success */
}
@@ -1990,32 +1994,42 @@ glXCreatePbuffer( Display *dpy, GLXFBConfig config,
break;
case GLX_PRESERVED_CONTENTS:
attrib++;
preserveContents = *attrib; /* ignored */
preserveContents = *attrib;
break;
case GLX_LARGEST_PBUFFER:
attrib++;
useLargest = *attrib; /* ignored */
useLargest = *attrib;
break;
default:
return 0;
}
}
/* not used at this time */
(void) useLargest;
(void) preserveContents;
if (width == 0 || height == 0)
return 0;
if (width > MAX_WIDTH || height > MAX_HEIGHT) {
/* If allocation would have failed and GLX_LARGEST_PBUFFER is set,
* allocate the largest possible buffer.
*/
if (useLargest) {
width = MAX_WIDTH;
height = MAX_HEIGHT;
}
}
xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height);
/* A GLXPbuffer handle must be an X Drawable because that's what
* glXMakeCurrent takes.
*/
if (xmbuf)
if (xmbuf) {
xmbuf->largestPbuffer = useLargest;
xmbuf->preservedContents = preserveContents;
return (GLXPbuffer) xmbuf->drawable;
else
}
else {
return 0;
}
}
@@ -2033,22 +2047,26 @@ void
glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
unsigned int *value )
{
GLuint width, height;
XMesaBuffer xmbuf = XMesaFindBuffer(dpy, draw);
if (!xmbuf)
return;
/* make sure buffer's dimensions are up to date */
xmesa_get_window_size(dpy, xmbuf, &width, &height);
switch (attribute) {
case GLX_WIDTH:
*value = xmesa_buffer_width(xmbuf);
*value = width;
break;
case GLX_HEIGHT:
*value = xmesa_buffer_width(xmbuf);
*value = height;
break;
case GLX_PRESERVED_CONTENTS:
*value = True;
*value = xmbuf->preservedContents;
break;
case GLX_LARGEST_PBUFFER:
*value = xmesa_buffer_width(xmbuf) * xmesa_buffer_height(xmbuf);
*value = xmbuf->largestPbuffer;
break;
case GLX_FBCONFIG_ID:
*value = xmbuf->xm_visual->visinfo->visualid;
@@ -2120,9 +2138,9 @@ glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
break;
case GLX_RENDER_TYPE:
if (xmctx->xm_visual->mesa_visual.rgbMode)
*value = GLX_RGBA_BIT;
*value = GLX_RGBA_TYPE;
else
*value = GLX_COLOR_INDEX_BIT;
*value = GLX_COLOR_INDEX_TYPE;
break;
case GLX_SCREEN:
*value = 0;

View File

@@ -228,7 +228,7 @@ get_drawable_size( Display *dpy, Drawable d, uint *width, uint *height )
* \param width returns width in pixels
* \param height returns height in pixels
*/
static void
void
xmesa_get_window_size(Display *dpy, XMesaBuffer b,
GLuint *width, GLuint *height)
{

View File

@@ -323,6 +323,9 @@ struct xmesa_buffer {
Colormap cmap; /* the X colormap */
BufferType type; /* window, pixmap, pbuffer or glxwindow */
GLboolean largestPbuffer; /**< for pbuffers */
GLboolean preservedContents; /**< for pbuffers */
XImage *tempImage;
unsigned long selectedEvents;/* for pbuffers only */
@@ -369,6 +372,10 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb);
extern XMesaBuffer
xmesa_find_buffer(Display *dpy, Colormap cmap, XMesaBuffer notThis);
extern void
xmesa_get_window_size(Display *dpy, XMesaBuffer b,
GLuint *width, GLuint *height);
extern void
xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer);

View File

@@ -42,8 +42,12 @@
#include "xorg_tracker.h"
#include "xf86Modes.h"
#ifdef HAVE_XEXTPROTO_71
#include <X11/extensions/dpmsconst.h>
#else
#define DPMS_SERVER
#include <X11/extensions/dpms.h>
#endif
#include "pipe/p_inlines.h"
#include "util/u_rect.h"

View File

@@ -42,8 +42,12 @@
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_XEXTPROTO_71
#include <X11/extensions/dpmsconst.h>
#else
#define DPMS_SERVER
#include <X11/extensions/dpms.h>
#endif
#include "X11/Xatom.h"

View File

@@ -596,8 +596,10 @@ driCreateDrawable(__GLXscreenConfigs * psc,
pdraw->drawable = drawable;
pdraw->psc = psc;
if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable))
if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) {
Xfree(pdraw);
return NULL;
}
/* Create a new drawable */
pdraw->driDrawable =

View File

@@ -50,7 +50,7 @@
#include <xcb/glx.h>
#endif
static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVendorName[] = "Mesa Project and SGI";
static const char __glXGLXClientVersion[] = "1.4";
@@ -398,6 +398,10 @@ CreateContext(Display * dpy, XVisualInfo * vis,
_XError(dpy, &error);
return None;
}
if (renderType == 0) {
/* Initialize renderType now */
renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE;
}
}
else {
mode = fbconfig;
@@ -484,6 +488,8 @@ CreateContext(Display * dpy, XVisualInfo * vis,
gc->imported = GL_TRUE;
}
gc->renderType = renderType;
return gc;
}
@@ -534,6 +540,16 @@ DestroyContext(Display * dpy, GLXContext gc)
imported = gc->imported;
gc->xid = None;
if (gc->currentDpy) {
/* This context is bound to some thread. According to the man page,
* we should not actually delete the context until it's unbound.
* Note that we set gc->xid = None above. In MakeContextCurrent()
* we check for that and delete the context there.
*/
__glXUnlock();
return;
}
#ifdef GLX_DIRECT_RENDERING
/* Destroy the direct rendering context */
if (gc->driContext) {
@@ -1575,7 +1591,7 @@ GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (),
* This function dynamically determines whether to use the EXT_import_context
* version of the protocol or the GLX 1.3 version of the protocol.
*/
static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
xGLXQueryContextReply reply;
@@ -1713,7 +1729,7 @@ GLX_ALIAS(int, glXQueryContextInfoEXT,
(Display * dpy, GLXContext ctx, int attribute, int *value),
(dpy, ctx, attribute, value), glXQueryContext)
PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
{
return ctx->xid;
}
@@ -2159,18 +2175,19 @@ GLX_ALIAS(int, glXGetFBConfigAttribSGIX,
(Display * dpy, GLXFBConfigSGIX config, int attribute, int *value),
(dpy, config, attribute, value), glXGetFBConfigAttrib)
PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
(Display * dpy, int screen, int *attrib_list,
int *nelements), (dpy, screen, attrib_list, nelements),
glXChooseFBConfig)
PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
(Display * dpy, int screen, int *attrib_list,
int *nelements), (dpy, screen, attrib_list, nelements),
glXChooseFBConfig)
PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
(Display * dpy, GLXFBConfigSGIX config),
(dpy, config), glXGetVisualFromFBConfig)
PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
(Display * dpy, GLXFBConfigSGIX config),
(dpy, config), glXGetVisualFromFBConfig)
PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX config,
Pixmap pixmap)
PUBLIC GLXPixmap
glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX config,
Pixmap pixmap)
{
xGLXVendorPrivateWithReplyReq *vpreq;
xGLXCreateGLXPixmapWithConfigSGIXReq *req;

View File

@@ -238,34 +238,10 @@ _mesa_meta_init(GLcontext *ctx)
void
_mesa_meta_free(GLcontext *ctx)
{
struct gl_meta_state *meta = ctx->Meta;
if (_mesa_get_current_context()) {
/* if there's no current context, these textures, buffers, etc should
* still get freed by _mesa_free_context_data().
*/
_mesa_DeleteTextures(1, &meta->TempTex.TexObj);
/* glBlitFramebuffer */
_mesa_DeleteBuffersARB(1, & meta->Blit.VBO);
_mesa_DeleteVertexArraysAPPLE(1, &meta->Blit.ArrayObj);
_mesa_DeletePrograms(1, &meta->Blit.DepthFP);
/* glClear */
_mesa_DeleteBuffersARB(1, & meta->Clear.VBO);
_mesa_DeleteVertexArraysAPPLE(1, &meta->Clear.ArrayObj);
/* glCopyPixels */
_mesa_DeleteBuffersARB(1, & meta->CopyPix.VBO);
_mesa_DeleteVertexArraysAPPLE(1, &meta->CopyPix.ArrayObj);
/* glDrawPixels */
_mesa_DeleteVertexArraysAPPLE(1, &meta->DrawPix.ArrayObj);
_mesa_DeletePrograms(1, &meta->DrawPix.DepthFP);
_mesa_DeletePrograms(1, &meta->DrawPix.StencilFP);
}
/* Note: Any textures, VBOs, etc, that we allocate should get
* freed by the normal context destruction code. But this would be
* the place to free other meta data someday.
*/
_mesa_free(ctx->Meta);
ctx->Meta = NULL;
}

View File

@@ -25,7 +25,7 @@ pcedit = sed \
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
-e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' \
-e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_INSTALL_DIR),' \
-e 's,@DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),'
dri.pc: dri.pc.in

View File

@@ -160,11 +160,18 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
pitch = intelObj->pitchOverride;
} else {
GLuint dst_x, dst_y;
intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
&dst_x, &dst_y);
dri_bo_reference(intelObj->mt->region->buffer);
i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
0, intelObj->
firstLevel);
/* XXX: This calculation is probably broken for tiled images with
* a non-page-aligned offset.
*/
i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
intelObj->mt->cpp;
format = translate_texture_format(firstImage->TexFormat->MesaFormat,
firstImage->InternalFormat);

View File

@@ -171,11 +171,18 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
pitch = intelObj->pitchOverride;
} else {
GLuint dst_x, dst_y;
intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
&dst_x, &dst_y);
dri_bo_reference(intelObj->mt->region->buffer);
i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
0, intelObj->
firstLevel);
/* XXX: This calculation is probably broken for tiled images with
* a non-page-aligned offset.
*/
i915->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
intelObj->mt->cpp;
format = translate_texture_format(firstImage->TexFormat->MesaFormat,
firstImage->InternalFormat,

View File

@@ -1194,12 +1194,16 @@ getFallbackString(GLuint bit)
/**
* Enable/disable a fallback flag.
* \param bit one of INTEL_FALLBACK_x flags.
*/
void
intelFallback(struct intel_context *intel, GLuint bit, GLboolean mode)
intelFallback(struct intel_context *intel, GLbitfield bit, GLboolean mode)
{
GLcontext *ctx = &intel->ctx;
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint oldfallback = intel->Fallback;
const GLbitfield oldfallback = intel->Fallback;
if (mode) {
intel->Fallback |= bit;

View File

@@ -156,6 +156,7 @@ static void upload_clip_prog(struct brw_context *brw)
key.attrs = brw->vs.prog_data->outputs_written;
/* _NEW_LIGHT */
key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
/* _NEW_TRANSFORM */
key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled);

View File

@@ -46,18 +46,17 @@ struct brw_clip_prog_key {
GLuint primitive:4;
GLuint nr_userclip:3;
GLuint do_flat_shading:1;
GLuint pv_first:1;
GLuint do_unfilled:1;
GLuint fill_cw:2; /* includes cull information */
GLuint fill_ccw:2; /* includes cull information */
GLuint offset_cw:1;
GLuint offset_ccw:1;
GLuint pad0:17;
GLuint copy_bfc_cw:1;
GLuint copy_bfc_ccw:1;
GLuint clip_mode:3;
GLuint pad1:27;
GLuint pad0:11;
GLfloat offset_factor;
GLfloat offset_units;
};

View File

@@ -269,8 +269,12 @@ void brw_emit_line_clip( struct brw_clip_compile *c )
brw_clip_line_alloc_regs(c);
brw_clip_init_ff_sync(c);
if (c->key.do_flat_shading)
brw_clip_copy_colors(c, 0, 1);
if (c->key.do_flat_shading) {
if (c->key.pv_first)
brw_clip_copy_colors(c, 1, 0);
else
brw_clip_copy_colors(c, 0, 1);
}
clip_and_emit_line(c);
}

View File

@@ -188,14 +188,20 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
brw_imm_ud(_3DPRIM_POLYGON));
is_poly = brw_IF(p, BRW_EXECUTE_1);
{
{
brw_clip_copy_colors(c, 1, 0);
brw_clip_copy_colors(c, 2, 0);
}
is_poly = brw_ELSE(p, is_poly);
{
brw_clip_copy_colors(c, 0, 2);
brw_clip_copy_colors(c, 1, 2);
if (c->key.pv_first) {
brw_clip_copy_colors(c, 1, 0);
brw_clip_copy_colors(c, 2, 0);
}
else {
brw_clip_copy_colors(c, 0, 2);
brw_clip_copy_colors(c, 1, 2);
}
}
brw_ENDIF(p, is_poly);
}

View File

@@ -115,7 +115,7 @@
* Handles blending and (presumably) depth and stencil testing.
*/
#define BRW_FALLBACK_TEXTURE 0x1
#define BRW_MAX_CURBE (32*16)
struct brw_context;
@@ -454,7 +454,6 @@ struct brw_context
GLuint primitive;
GLboolean emit_state_always;
GLboolean tmp_fallback;
GLboolean no_batch_wrap;
struct {

View File

@@ -375,7 +375,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
* isn't an issue at this point.
*/
if (brw->vb.nr_enabled >= BRW_VEP_MAX) {
intel->Fallback = 1;
intel->Fallback = GL_TRUE; /* boolean, not bitfield */
return;
}
@@ -427,7 +427,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
/* Position array not properly enabled:
*/
if (input->glarray->StrideB == 0) {
intel->Fallback = 1;
intel->Fallback = GL_TRUE; /* boolean, not bitfield */
return;
}
@@ -536,16 +536,9 @@ static void brw_emit_vertices(struct brw_context *brw)
I915_GEM_DOMAIN_VERTEX, 0,
input->offset);
if (BRW_IS_IGDNG(brw)) {
if (input->stride) {
OUT_RELOC(input->bo,
I915_GEM_DOMAIN_VERTEX, 0,
input->offset + input->stride * input->count);
} else {
assert(input->count == 1);
OUT_RELOC(input->bo,
I915_GEM_DOMAIN_VERTEX, 0,
input->offset + input->element_size);
}
OUT_RELOC(input->bo,
I915_GEM_DOMAIN_VERTEX, 0,
input->bo->size - 1);
} else
OUT_BATCH(input->stride ? input->count : 0);
OUT_BATCH(0); /* Instance data step rate */
@@ -726,7 +719,7 @@ static void brw_emit_index_buffer(struct brw_context *brw)
brw->ib.offset);
OUT_RELOC(brw->ib.bo,
I915_GEM_DOMAIN_VERTEX, 0,
brw->ib.offset + brw->ib.size);
brw->ib.offset + brw->ib.size - 1);
OUT_BATCH( 0 );
ADVANCE_BATCH();
}

View File

@@ -133,7 +133,11 @@ const struct brw_tracked_state brw_check_fallback = {
/* Not used:
/**
* Called by the INTEL_FALLBACK() macro.
* NOTE: this is a no-op for the i965 driver. The brw->intel.Fallback
* field is treated as a boolean, not a bitmask. It's only set in a
* couple of places.
*/
void intelFallback( struct intel_context *intel, GLuint bit, GLboolean mode )
{

View File

@@ -85,10 +85,10 @@ static void compile_gs_prog( struct brw_context *brw,
*/
switch (key->primitive) {
case GL_QUADS:
brw_gs_quads( &c );
brw_gs_quads( &c, key );
break;
case GL_QUAD_STRIP:
brw_gs_quad_strip( &c );
brw_gs_quad_strip( &c, key );
break;
case GL_LINE_LOOP:
brw_gs_lines( &c );
@@ -149,6 +149,7 @@ static const GLenum gs_prim[GL_POLYGON+1] = {
static void populate_key( struct brw_context *brw,
struct brw_gs_prog_key *key )
{
GLcontext *ctx = &brw->intel.ctx;
memset(key, 0, sizeof(*key));
/* CACHE_NEW_VS_PROG */
@@ -158,6 +159,9 @@ static void populate_key( struct brw_context *brw,
key->primitive = gs_prim[brw->primitive];
key->hint_gs_always = 0; /* debug code? */
/* _NEW_LIGHT */
key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
key->need_gs_prog = (key->hint_gs_always ||
brw->primitive == GL_QUADS ||
@@ -193,7 +197,7 @@ static void prepare_gs_prog(struct brw_context *brw)
const struct brw_tracked_state brw_gs_prog = {
.dirty = {
.mesa = 0,
.mesa = _NEW_LIGHT,
.brw = BRW_NEW_PRIMITIVE,
.cache = CACHE_NEW_VS_PROG
},

View File

@@ -43,8 +43,9 @@ struct brw_gs_prog_key {
GLuint attrs:32;
GLuint primitive:4;
GLuint hint_gs_always:1;
GLuint pv_first:1;
GLuint need_gs_prog:1;
GLuint pad:26;
GLuint pad:25;
};
struct brw_gs_compile {
@@ -67,8 +68,8 @@ struct brw_gs_compile {
#define ATTR_SIZE (4*4)
void brw_gs_quads( struct brw_gs_compile *c );
void brw_gs_quad_strip( struct brw_gs_compile *c );
void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key );
void brw_gs_tris( struct brw_gs_compile *c );
void brw_gs_lines( struct brw_gs_compile *c );
void brw_gs_points( struct brw_gs_compile *c );

View File

@@ -120,7 +120,7 @@ static void brw_gs_ff_sync(struct brw_gs_compile *c, int num_prim)
}
void brw_gs_quads( struct brw_gs_compile *c )
void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key )
{
brw_gs_alloc_regs(c, 4);
@@ -128,23 +128,39 @@ void brw_gs_quads( struct brw_gs_compile *c )
* is the PV for quads, but vertex 0 for polygons:
*/
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
brw_gs_ff_sync(c, 1);
if (key->pv_first) {
brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[3], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
else {
brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
}
void brw_gs_quad_strip( struct brw_gs_compile *c )
void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key )
{
brw_gs_alloc_regs(c, 4);
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
if (key->pv_first) {
brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[3], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
else {
brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
}
void brw_gs_tris( struct brw_gs_compile *c )

View File

@@ -113,7 +113,8 @@ struct brw_sf_unit_key {
unsigned int nr_urb_entries, urb_size, sfsize;
GLenum front_face, cull_face, provoking_vertex;
GLenum front_face, cull_face;
unsigned pv_first:1;
unsigned scissor:1;
unsigned line_smooth:1;
unsigned point_sprite:1;
@@ -154,7 +155,7 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key)
key->point_attenuated = ctx->Point._Attenuated;
/* _NEW_LIGHT */
key->provoking_vertex = ctx->Light.ProvokingVertex;
key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
}
@@ -287,7 +288,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
/* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons:
*/
if (key->provoking_vertex == GL_LAST_VERTEX_CONVENTION) {
if (!key->pv_first) {
sf.sf7.trifan_pv = 2;
sf.sf7.linestrip_pv = 1;
sf.sf7.tristrip_pv = 2;

View File

@@ -151,6 +151,7 @@ void brw_state_cache_check_size( struct brw_context *brw );
void brw_init_caches( struct brw_context *brw );
void brw_destroy_caches( struct brw_context *brw );
void brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo);
/***********************************************************************
* brw_state_batch.c

View File

@@ -517,6 +517,55 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache)
brw->state.dirty.cache |= ~0;
}
/* Clear all entries from the cache that point to the given bo.
*
* This lets us release memory for reuse earlier for known-dead buffers,
* at the cost of walking the entire hash table.
*/
void
brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo)
{
struct brw_cache_item **prev;
GLuint i;
if (INTEL_DEBUG & DEBUG_STATE)
_mesa_printf("%s\n", __FUNCTION__);
for (i = 0; i < cache->size; i++) {
for (prev = &cache->items[i]; *prev;) {
struct brw_cache_item *c = *prev;
int j;
for (j = 0; j < c->nr_reloc_bufs; j++) {
if (c->reloc_bufs[j] == bo)
break;
}
if (j != c->nr_reloc_bufs) {
*prev = c->next;
for (j = 0; j < c->nr_reloc_bufs; j++)
dri_bo_unreference(c->reloc_bufs[j]);
dri_bo_unreference(c->bo);
free((void *)c->key);
free(c);
cache->n_items--;
/* Delete up the tree. Notably we're trying to get from
* a request to delete the surface, to deleting the surface state
* object, to deleting the binding table. We're slack and restart
* the deletion process when we do this because the other delete
* may kill our *prev.
*/
brw_state_cache_bo_delete(cache, c->bo);
prev = &cache->items[i];
} else {
prev = &(*prev)->next;
}
}
}
}
void
brw_state_cache_check_size(struct brw_context *brw)

View File

@@ -308,7 +308,7 @@ void brw_validate_state( struct brw_context *brw )
if (brw->state.dirty.brw & BRW_NEW_CONTEXT)
brw_clear_batch_cache(brw);
brw->intel.Fallback = 0;
brw->intel.Fallback = GL_FALSE; /* boolean, not bitfield */
/* do prepare stage for all atoms */
for (i = 0; i < Elements(atoms); i++) {

View File

@@ -86,10 +86,10 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
mt->pitch = intel_miptree_pitch_align(intel, mt, tiling, mt->pitch);
if (mt->compressed) {
qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * mt->pitch * mt->cpp;
qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4;
mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * 6;
} else {
qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * mt->pitch * mt->cpp;
qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h);
mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * 6;
}
@@ -102,7 +102,8 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
height, 1);
for (q = 0; q < nr_images; q++)
intel_miptree_set_image_offset_ex(mt, level, q, x, y, q * qpitch);
intel_miptree_set_image_offset(mt, level, q,
x, y + q * qpitch);
if (mt->compressed)
img_height = MAX2(1, height/4);

View File

@@ -331,63 +331,65 @@ static void unalias3( struct brw_vs_compile *c,
}
}
static void emit_sop( struct brw_compile *p,
static void emit_sop( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1,
GLuint cond)
{
struct brw_compile *p = &c->func;
brw_MOV(p, dst, brw_imm_f(0.0f));
brw_CMP(p, brw_null_reg(), cond, arg0, arg1);
brw_MOV(p, dst, brw_imm_f(1.0f));
brw_set_predicate_control_flag_value(p, 0xff);
}
static void emit_seq( struct brw_compile *p,
static void emit_seq( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_EQ);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_EQ);
}
static void emit_sne( struct brw_compile *p,
static void emit_sne( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_NEQ);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_NEQ);
}
static void emit_slt( struct brw_compile *p,
static void emit_slt( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_L);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_L);
}
static void emit_sle( struct brw_compile *p,
static void emit_sle( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_LE);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_LE);
}
static void emit_sgt( struct brw_compile *p,
static void emit_sgt( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_G);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_G);
}
static void emit_sge( struct brw_compile *p,
static void emit_sge( struct brw_vs_compile *c,
struct brw_reg dst,
struct brw_reg arg0,
struct brw_reg arg1 )
{
emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_GE);
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE);
}
static void emit_max( struct brw_compile *p,
@@ -912,6 +914,7 @@ get_src_reg( struct brw_vs_compile *c,
case PROGRAM_CONSTANT:
case PROGRAM_UNIFORM:
case PROGRAM_ENV_PARAM:
case PROGRAM_LOCAL_PARAM:
if (c->vp->use_const_buffer) {
return get_constant(c, inst, argIndex);
}
@@ -930,7 +933,6 @@ get_src_reg( struct brw_vs_compile *c,
/* this is a normal case since we loop over all three src args */
return brw_null_reg();
case PROGRAM_LOCAL_PARAM:
case PROGRAM_WRITE_ONLY:
default:
assert(0);
@@ -1453,25 +1455,25 @@ void brw_vs_emit(struct brw_vs_compile *c )
break;
case OPCODE_SEQ:
emit_seq(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_seq);
break;
case OPCODE_SIN:
emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, args[0], BRW_MATH_PRECISION_FULL);
break;
case OPCODE_SNE:
emit_sne(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_sne);
break;
case OPCODE_SGE:
emit_sge(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_sge);
break;
case OPCODE_SGT:
emit_sgt(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_sgt);
break;
case OPCODE_SLT:
emit_slt(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_slt);
break;
case OPCODE_SLE:
emit_sle(p, dst, args[0], args[1]);
unalias2(c, dst, args[0], args[1], emit_sle);
break;
case OPCODE_SUB:
brw_ADD(p, dst, args[0], negate(args[1]));

View File

@@ -53,6 +53,7 @@ brw_vs_update_constant_buffer(struct brw_context *brw)
const struct gl_program_parameter_list *params = vp->program.Base.Parameters;
const int size = params->NumParameters * 4 * sizeof(GLfloat);
drm_intel_bo *const_buffer;
int i;
/* BRW_NEW_VERTEX_PROGRAM */
if (!vp->use_const_buffer)
@@ -62,7 +63,16 @@ brw_vs_update_constant_buffer(struct brw_context *brw)
size, 64);
/* _NEW_PROGRAM_CONSTANTS */
dri_bo_subdata(const_buffer, 0, size, params->ParameterValues);
/* Updates the ParamaterValues[i] pointers for all parameters of the
* basic type of PROGRAM_STATE_VAR.
*/
_mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters);
for (i = 0; i < params->NumParameters; i++) {
dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float),
params->ParameterValues[i]);
}
return const_buffer;
}

View File

@@ -745,22 +745,32 @@ static void emit_tex( struct brw_wm_compile *c,
abort();
}
if (inst->tex_shadow) {
nr = 4;
emit |= WRITEMASK_W;
}
/* For shadow comparisons, we have to supply u,v,r. */
if (inst->tex_shadow)
nr = 3;
msgLength = 1;
for (i = 0; i < nr; i++) {
static const GLuint swz[4] = {0,1,2,2};
if (emit & (1<<i))
brw_MOV(p, brw_message_reg(msgLength+1), arg[swz[i]]);
if (emit & (1<<i))
brw_MOV(p, brw_message_reg(msgLength+1), arg[i]);
else
brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0));
msgLength += 2;
}
/* Fill in the cube map array index value. */
if (BRW_IS_IGDNG(p->brw) && inst->tex_shadow) {
brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0));
msgLength += 2;
}
/* Fill in the shadow comparison reference value. */
if (inst->tex_shadow) {
brw_MOV(p, brw_message_reg(msgLength+1), arg[2]);
msgLength += 2;
}
responseLength = 8; /* always */
if (BRW_IS_IGDNG(p->brw)) {

View File

@@ -441,6 +441,10 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
intel_region_buffer(intel, irb->region,
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
int x1 = b.x1 + irb->region->draw_x;
int y1 = b.y1 + irb->region->draw_y;
int x2 = b.x2 + irb->region->draw_x;
int y2 = b.y2 + irb->region->draw_y;
GLuint clearVal;
GLint pitch, cpp;
@@ -449,11 +453,10 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
pitch = irb->region->pitch;
cpp = irb->region->cpp;
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
__FUNCTION__,
irb->region->buffer, (pitch * cpp),
irb->region->draw_offset,
b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1);
x1, y1, x2 - x1, y2 - y1);
BR13 = 0xf0 << 16;
CMD = XY_COLOR_BLT_CMD;
@@ -526,17 +529,17 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
buf, irb->Base.Name);
*/
assert(b.x1 < b.x2);
assert(b.y1 < b.y2);
assert(x1 < x2);
assert(y1 < y2);
BEGIN_BATCH(6, REFERENCES_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((b.y1 << 16) | b.x1);
OUT_BATCH((b.y2 << 16) | b.x2);
OUT_BATCH((y1 << 16) | x1);
OUT_BATCH((y2 << 16) | x2);
OUT_RELOC(write_buffer,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
irb->region->draw_offset);
0);
OUT_BATCH(clearVal);
ADVANCE_BATCH();
clearMask &= ~bufBit; /* turn off bit, for faster loop exit */

View File

@@ -839,7 +839,7 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
_vbo_DestroyContext(&intel->ctx);
_swrast_DestroyContext(&intel->ctx);
intel->Fallback = 0; /* don't call _swrast_Flush later */
intel->Fallback = 0x0; /* don't call _swrast_Flush later */
intel_batchbuffer_free(intel->batch);
intel->batch = NULL;
@@ -944,10 +944,23 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
__DRIdrawablePrivate * driReadPriv)
{
__DRIscreenPrivate *psp = driDrawPriv->driScreenPriv;
struct intel_context *intel;
GET_CURRENT_CONTEXT(curCtx);
if (driContextPriv)
intel = (struct intel_context *) driContextPriv->driverPrivate;
else
intel = NULL;
/* According to the glXMakeCurrent() man page: "Pending commands to
* the previous context, if any, are flushed before it is released."
* But only flush if we're actually changing contexts.
*/
if (intel_context(curCtx) && intel_context(curCtx) != intel) {
_mesa_flush(curCtx);
}
if (driContextPriv) {
struct intel_context *intel =
(struct intel_context *) driContextPriv->driverPrivate;
struct intel_framebuffer *intel_fb =
(struct intel_framebuffer *) driDrawPriv->driverPrivate;
GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate;
@@ -993,41 +1006,35 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
/* The drawbuffer won't always be updated by _mesa_make_current:
*/
if (intel->ctx.DrawBuffer == &intel_fb->Base) {
intel->driReadDrawable = driReadPriv;
if (intel->driReadDrawable != driReadPriv)
intel->driReadDrawable = driReadPriv;
if (intel->driDrawable != driDrawPriv) {
if (driDrawPriv->swap_interval == (unsigned)-1) {
int i;
if (intel->driDrawable != driDrawPriv) {
if (driDrawPriv->swap_interval == (unsigned)-1) {
int i;
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
/* Prevent error printf if one crtc is disabled, this will
* be properly calculated in intelWindowMoved() next.
*/
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
/* Prevent error printf if one crtc is disabled, this will
* be properly calculated in intelWindowMoved() next.
*/
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv);
intel_fb->vbl_waited = driDrawPriv->vblSeq;
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv);
intel_fb->vbl_waited = driDrawPriv->vblSeq;
for (i = 0; i < 2; i++) {
if (intel_fb->color_rb[i])
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
}
}
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
}
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
for (i = 0; i < 2; i++) {
if (intel_fb->color_rb[i])
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
}
}
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
}
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
}
else {
_mesa_make_current(NULL, NULL, NULL);

View File

@@ -61,6 +61,10 @@ typedef void (*intel_line_func) (struct intel_context *, intelVertex *,
intelVertex *);
typedef void (*intel_point_func) (struct intel_context *, intelVertex *);
/**
* Bits for intel->Fallback field
*/
/*@{*/
#define INTEL_FALLBACK_DRAW_BUFFER 0x1
#define INTEL_FALLBACK_READ_BUFFER 0x2
#define INTEL_FALLBACK_DEPTH_BUFFER 0x4
@@ -68,8 +72,10 @@ typedef void (*intel_point_func) (struct intel_context *, intelVertex *);
#define INTEL_FALLBACK_USER 0x10
#define INTEL_FALLBACK_RENDERMODE 0x20
#define INTEL_FALLBACK_TEXTURE 0x40
#define INTEL_FALLBACK_DRIVER 0x1000 /**< first for drivers */
/*@}*/
extern void intelFallback(struct intel_context *intel, GLuint bit,
extern void intelFallback(struct intel_context *intel, GLbitfield bit,
GLboolean mode);
#define FALLBACK( intel, bit, mode ) intelFallback( intel, bit, mode )
@@ -171,7 +177,7 @@ struct intel_context
struct dri_metaops meta;
GLint refcount;
GLuint Fallback;
GLbitfield Fallback; /**< mask of INTEL_FALLBACK_x bits */
GLuint NewGLState;
dri_bufmgr *bufmgr;

View File

@@ -385,6 +385,7 @@ intel_create_renderbuffer(GLenum intFormat)
default:
_mesa_problem(NULL,
"Unexpected intFormat in intel_create_renderbuffer");
_mesa_free(irb);
return NULL;
}
@@ -571,7 +572,7 @@ intel_render_texture(GLcontext * ctx,
= att->Texture->Image[att->CubeMapFace][att->TextureLevel];
struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
struct intel_texture_image *intel_image;
GLuint imageOffset;
GLuint dst_x, dst_y;
(void) fb;
@@ -618,18 +619,16 @@ intel_render_texture(GLcontext * ctx,
}
/* compute offset of the particular 2D image within the texture region */
imageOffset = intel_miptree_image_offset(intel_image->mt,
att->CubeMapFace,
att->TextureLevel);
intel_miptree_get_image_offset(intel_image->mt,
att->TextureLevel,
att->CubeMapFace,
att->Zoffset,
&dst_x, &dst_y);
if (att->Texture->Target == GL_TEXTURE_3D) {
const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt,
att->TextureLevel);
imageOffset += offsets[att->Zoffset];
}
/* store that offset in the region */
intel_image->mt->region->draw_offset = imageOffset;
intel_image->mt->region->draw_offset = (dst_y * intel_image->mt->pitch +
dst_x) * intel_image->mt->cpp;
intel_image->mt->region->draw_x = dst_x;
intel_image->mt->region->draw_y = dst_y;
/* update drawing region, etc */
intel_draw_buffer(ctx, fb);

View File

@@ -29,6 +29,9 @@
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
#include "intel_chipset.h"
#ifndef I915
#include "brw_state.h"
#endif
#include "main/enums.h"
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
@@ -131,8 +134,10 @@ intel_miptree_create(struct intel_context *intel,
/*
* pitch == 0 || height == 0 indicates the null texture
*/
if (!mt || !mt->pitch || !mt->total_height)
if (!mt || !mt->pitch || !mt->total_height) {
free(mt);
return NULL;
}
mt->region = intel_region_alloc(intel,
tiling,
@@ -269,11 +274,25 @@ intel_miptree_release(struct intel_context *intel,
DBG("%s deleting %p\n", __FUNCTION__, *mt);
#ifndef I915
/* Free up cached binding tables holding a reference on our buffer, to
* avoid excessive memory consumption.
*
* This isn't as aggressive as we could be, as we'd like to do
* it from any time we free the last ref on a region. But intel_region.c
* is context-agnostic. Perhaps our constant state cache should be, as
* well.
*/
brw_state_cache_bo_delete(&brw_context(&intel->ctx)->surface_cache,
(*mt)->region->buffer);
#endif
intel_region_release(&((*mt)->region));
for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
if ((*mt)->level[i].image_offset)
free((*mt)->level[i].image_offset);
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
free((*mt)->level[i].x_offset);
free((*mt)->level[i].y_offset);
}
free(*mt);
}
@@ -334,82 +353,58 @@ intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
mt->level[level].height = h;
mt->level[level].depth = d;
mt->level[level].level_offset = (x + y * mt->pitch) * mt->cpp;
mt->level[level].level_x = x;
mt->level[level].level_y = y;
mt->level[level].nr_images = nr_images;
DBG("%s level %d size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__,
level, w, h, d, x, y, mt->level[level].level_offset);
/* Not sure when this would happen, but anyway:
*/
if (mt->level[level].image_offset) {
free(mt->level[level].image_offset);
mt->level[level].image_offset = NULL;
}
assert(nr_images);
assert(!mt->level[level].x_offset);
mt->level[level].image_offset = malloc(nr_images * sizeof(GLuint));
mt->level[level].image_offset[0] = 0;
mt->level[level].x_offset = malloc(nr_images * sizeof(GLuint));
mt->level[level].x_offset[0] = mt->level[level].level_x;
mt->level[level].y_offset = malloc(nr_images * sizeof(GLuint));
mt->level[level].y_offset[0] = mt->level[level].level_y;
}
void
intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt,
GLuint level, GLuint img,
GLuint x, GLuint y,
GLuint offset)
{
if (img == 0 && level == 0)
assert(x == 0 && y == 0);
assert(img < mt->level[level].nr_images);
mt->level[level].image_offset[img] = (x + y * mt->pitch) * mt->cpp + offset;
DBG("%s level %d img %d pos %d,%d image_offset %x\n",
__FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]);
}
void
intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
GLuint level, GLuint img,
GLuint x, GLuint y)
{
intel_miptree_set_image_offset_ex(mt, level, img, x, y, 0);
if (img == 0 && level == 0)
assert(x == 0 && y == 0);
assert(img < mt->level[level].nr_images);
mt->level[level].x_offset[img] = mt->level[level].level_x + x;
mt->level[level].y_offset[img] = mt->level[level].level_y + y;
DBG("%s level %d img %d pos %d,%d\n",
__FUNCTION__, level, img,
mt->level[level].x_offset[img], mt->level[level].y_offset[img]);
}
/* Although we use the image_offset[] array to store relative offsets
* to cube faces, Mesa doesn't know anything about this and expects
* each cube face to be treated as a separate image.
*
* These functions present that view to mesa:
*/
const GLuint *
intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level)
void
intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
GLuint level, GLuint face, GLuint depth,
GLuint *x, GLuint *y)
{
static const GLuint zero = 0;
if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1)
return &zero;
else
return mt->level[level].image_offset;
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) {
*x = mt->level[level].x_offset[face];
*y = mt->level[level].y_offset[face];
} else if (mt->target == GL_TEXTURE_3D) {
*x = mt->level[level].x_offset[depth];
*y = mt->level[level].y_offset[depth];
} else {
*x = mt->level[level].x_offset[0];
*y = mt->level[level].y_offset[0];
}
}
GLuint
intel_miptree_image_offset(struct intel_mipmap_tree *mt,
GLuint face, GLuint level)
{
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
return (mt->level[level].level_offset +
mt->level[level].image_offset[face]);
else
return mt->level[level].level_offset;
}
/**
* Map a teximage in a mipmap tree.
* \param row_stride returns row stride in bytes
@@ -425,6 +420,7 @@ intel_miptree_image_map(struct intel_context * intel,
GLuint level,
GLuint * row_stride, GLuint * image_offsets)
{
GLuint x, y;
DBG("%s \n", __FUNCTION__);
if (row_stride)
@@ -433,17 +429,23 @@ intel_miptree_image_map(struct intel_context * intel,
if (mt->target == GL_TEXTURE_3D) {
int i;
for (i = 0; i < mt->level[level].depth; i++)
image_offsets[i] = mt->level[level].image_offset[i] / mt->cpp;
for (i = 0; i < mt->level[level].depth; i++) {
intel_miptree_get_image_offset(mt, level, face, i,
&x, &y);
image_offsets[i] = x + y * mt->pitch;
}
return intel_region_map(intel, mt->region);
} else {
assert(mt->level[level].depth == 1);
assert(mt->target == GL_TEXTURE_CUBE_MAP ||
mt->level[level].image_offset[0] == 0);
intel_miptree_get_image_offset(mt, level, face, 0,
&x, &y);
image_offsets[0] = 0;
}
return (intel_region_map(intel, mt->region) +
intel_miptree_image_offset(mt, face, level));
return intel_region_map(intel, mt->region) +
(x + y * mt->pitch) * mt->cpp;
}
}
void
@@ -468,20 +470,19 @@ intel_miptree_image_data(struct intel_context *intel,
GLuint src_image_pitch)
{
GLuint depth = dst->level[level].depth;
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
GLuint i;
GLuint height = 0;
DBG("%s: %d/%d\n", __FUNCTION__, face, level);
for (i = 0; i < depth; i++) {
GLuint dst_x, dst_y, height;
intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y);
height = dst->level[level].height;
if(dst->compressed)
height = (height + 3) / 4;
intel_region_data(intel,
dst->region,
dst_offset + dst_depth_offset[i], /* dst_offset */
0, 0, /* dstx, dsty */
dst->region, 0, dst_x, dst_y,
src,
src_row_pitch,
0, 0, /* source x, y */
@@ -503,10 +504,7 @@ intel_miptree_image_copy(struct intel_context *intel,
GLuint width = src->level[level].width;
GLuint height = src->level[level].height;
GLuint depth = src->level[level].depth;
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
GLuint src_offset = intel_miptree_image_offset(src, face, level);
const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level);
GLuint src_x, src_y, dst_x, dst_y;
GLuint i;
GLboolean success;
@@ -519,22 +517,23 @@ intel_miptree_image_copy(struct intel_context *intel,
}
for (i = 0; i < depth; i++) {
intel_miptree_get_image_offset(src, level, face, i, &src_x, &src_y);
intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y);
success = intel_region_copy(intel,
dst->region, dst_offset + dst_depth_offset[i],
0, 0,
src->region, src_offset + src_depth_offset[i],
0, 0, width, height, GL_COPY);
dst->region, 0, dst_x, dst_y,
src->region, 0, src_x, src_y, width, height,
GL_COPY);
if (!success) {
GLubyte *src_ptr, *dst_ptr;
src_ptr = intel_region_map(intel, src->region);
dst_ptr = intel_region_map(intel, dst->region);
_mesa_copy_rect(dst_ptr + dst_offset + dst_depth_offset[i],
_mesa_copy_rect(dst_ptr + dst->cpp * (dst_x + dst_y * dst->pitch),
dst->cpp,
dst->pitch,
0, 0, width, height,
src_ptr + src_offset + src_depth_offset[i],
src_ptr + src->cpp * (src_x + src_y * src->pitch),
src->pitch,
0, 0);
intel_region_unmap(intel, src->region);

View File

@@ -70,6 +70,10 @@ struct intel_mipmap_level
* always zero in that case.
*/
GLuint level_offset;
/** Offset to this miptree level, used in computing x_offset. */
GLuint level_x;
/** Offset to this miptree level, used in computing y_offset. */
GLuint level_y;
GLuint width;
GLuint height;
/** Depth of the mipmap at this level: 1 for 1D/2D/CUBE, n for 3D. */
@@ -86,7 +90,7 @@ struct intel_mipmap_level
* compute the offsets of depth/cube images within a mipmap level,
* so have to store them as a lookup table.
*/
GLuint *image_offset;
GLuint *x_offset, *y_offset;
};
struct intel_mipmap_tree
@@ -176,19 +180,10 @@ GLubyte *intel_miptree_image_map(struct intel_context *intel,
void intel_miptree_image_unmap(struct intel_context *intel,
struct intel_mipmap_tree *mt);
/* Return the linear offset of an image relative to the start of the
* tree:
*/
GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt,
GLuint face, GLuint level);
/* Return pointers to each 2d slice within an image. Indexed by depth
* value.
*/
const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt,
GLuint level);
void
intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
GLuint level, GLuint face, GLuint depth,
GLuint *x, GLuint *y);
void intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
GLuint level,
@@ -196,16 +191,10 @@ void intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
GLuint x, GLuint y,
GLuint w, GLuint h, GLuint d);
void intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt,
GLuint level,
GLuint img, GLuint x, GLuint y,
GLuint offset);
void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
GLuint level,
GLuint img, GLuint x, GLuint y);
/* Upload an image into a tree
*/
void intel_miptree_image_data(struct intel_context *intel,

View File

@@ -435,13 +435,14 @@ intel_texture_bitmap(GLcontext * ctx,
}
/* Save GL state before we start setting up our drawing */
_mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT |
GL_VIEWPORT_BIT);
_mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_POLYGON_BIT |
GL_TEXTURE_BIT | GL_VIEWPORT_BIT);
_mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT |
GL_CLIENT_PIXEL_STORE_BIT);
old_active_texture = ctx->Texture.CurrentUnit;
_mesa_Disable(GL_POLYGON_STIPPLE);
_mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
/* Upload our bitmap data to an alpha texture */
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB);
@@ -501,8 +502,6 @@ intel_texture_bitmap(GLcontext * ctx,
meta_restore_vertex_program(&intel->meta);
_mesa_PopClientAttrib();
_mesa_Disable(GL_TEXTURE_2D); /* asserted that it was disabled at entry */
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture);
_mesa_PopAttrib();
_mesa_DeleteTextures(1, &texname);

View File

@@ -236,14 +236,14 @@ do_blit_readpixels(GLcontext * ctx,
intelFlush(&intel->ctx);
LOCK_HARDWARE(intel);
if (intel->driDrawable->numClipRects) {
if (intel->driReadDrawable->numClipRects) {
GLboolean all = (width * height * src->cpp == dst->Base.Size &&
x == 0 && dst_offset == 0);
dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst,
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
__DRIdrawablePrivate *dPriv = intel->driDrawable;
__DRIdrawablePrivate *dPriv = intel->driReadDrawable;
int nbox = dPriv->numClipRects;
drm_clip_rect_t *box = dPriv->pClipRects;
drm_clip_rect_t rect;

View File

@@ -62,6 +62,8 @@ struct intel_region
GLuint map_refcount; /**< Reference count for mapping */
GLuint draw_offset; /**< Offset of drawing address within the region */
GLuint draw_x, draw_y; /**< Offset of drawing within the region */
uint32_t tiling; /**< Which tiling mode the region is in */
uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */
drmAddress classic_map; /**< drmMap of the region when not in GEM mode */

View File

@@ -163,6 +163,9 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
int x_tile_number, y_tile_number;
int tile_off, tile_base;
x += irb->region->draw_x;
y += irb->region->draw_y;
tile_stride = (irb->region->pitch * irb->region->cpp) << 3;
xbyte = x * irb->region->cpp;
@@ -218,6 +221,9 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
int x_tile_number, y_tile_number;
int tile_off, tile_base;
x += irb->region->draw_x;
y += irb->region->draw_y;
tile_stride = (irb->region->pitch * irb->region->cpp) << 5;
xbyte = x * irb->region->cpp;

View File

@@ -48,8 +48,8 @@
#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT
#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE
#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(X_TILE(_x, _y), v)
#define GET_VALUE(_x, _y) INTEL_READ_VALUE(X_TILE(_x, _y))
#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(Y_TILE(_x, _y), v)
#define GET_VALUE(_x, _y) INTEL_READ_VALUE(Y_TILE(_x, _y))
#define TAG(x) INTEL_TAG(intel_YTile_##x)
#define TAG2(x, y) INTEL_TAG(intel_YTile_##x)##y
#include "spantmp2.h"

View File

@@ -114,7 +114,7 @@ static void intel_check_sync(GLcontext *ctx, struct gl_sync_object *s)
{
struct intel_sync_object *sync = (struct intel_sync_object *)s;
if (sync->bo && drm_intel_bo_busy(sync->bo)) {
if (sync->bo && !drm_intel_bo_busy(sync->bo)) {
drm_intel_bo_unreference(sync->bo);
sync->bo = NULL;
s->StatusFlag = 1;

View File

@@ -115,27 +115,29 @@ do_copy_texsubimage(struct intel_context *intel,
drm_intel_bo *dst_bo = intel_region_buffer(intel,
intelImage->mt->region,
INTEL_WRITE_PART);
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
intelImage->face,
intelImage->level);
const GLint orig_x = x;
const GLint orig_y = y;
GLuint image_x, image_y;
GLshort src_pitch;
intel_miptree_get_image_offset(intelImage->mt,
intelImage->level,
intelImage->face,
0,
&image_x, &image_y);
/* Update dst for clipped src. Need to also clip the source rect. */
dstx += x - orig_x;
dsty += y - orig_y;
/* Can't blit to tiled buffers with non-tile-aligned offset. */
if (intelImage->mt->region->tiling != I915_TILING_NONE &&
(image_offset & 4095) != 0) {
if (intelImage->mt->region->tiling == I915_TILING_Y) {
UNLOCK_HARDWARE(intel);
return GL_FALSE;
}
if (ctx->ReadBuffer->Name == 0) {
/* reading from a window, adjust x, y */
__DRIdrawablePrivate *dPriv = intel->driDrawable;
const __DRIdrawablePrivate *dPriv = intel->driReadDrawable;
y = dPriv->y + (dPriv->h - (y + height));
x += dPriv->x;
@@ -156,13 +158,14 @@ do_copy_texsubimage(struct intel_context *intel,
intelImage->mt->cpp,
src_pitch,
src->buffer,
0,
src->draw_offset,
src->tiling,
intelImage->mt->pitch,
dst_bo,
image_offset,
0,
intelImage->mt->region->tiling,
x, y, dstx, dsty, width, height,
x, y, image_x + dstx, image_y + dsty,
width, height,
GL_COPY)) {
UNLOCK_HARDWARE(intel);
return GL_FALSE;

View File

@@ -204,7 +204,7 @@ try_pbo_upload(struct intel_context *intel,
{
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset, src_stride;
GLuint dst_offset, dst_stride;
GLuint dst_x, dst_y, dst_stride;
if (unpack->BufferObj->Name == 0 ||
intel->ctx._ImageTransferState ||
@@ -221,9 +221,9 @@ try_pbo_upload(struct intel_context *intel,
else
src_stride = width;
dst_offset = intel_miptree_image_offset(intelImage->mt,
intelImage->face,
intelImage->level);
intel_miptree_get_image_offset(intelImage->mt, intelImage->level,
intelImage->face, 0,
&dst_x, &dst_y);
dst_stride = intelImage->mt->pitch;
@@ -239,8 +239,8 @@ try_pbo_upload(struct intel_context *intel,
if (!intelEmitCopyBlit(intel,
intelImage->mt->cpp,
src_stride, src_buffer, src_offset, GL_FALSE,
dst_stride, dst_buffer, dst_offset, GL_FALSE,
0, 0, 0, 0, width, height,
dst_stride, dst_buffer, 0, GL_FALSE,
0, 0, dst_x, dst_y, width, height,
GL_COPY)) {
UNLOCK_HARDWARE(intel);
return GL_FALSE;
@@ -262,7 +262,7 @@ try_pbo_zcopy(struct intel_context *intel,
{
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset, src_stride;
GLuint dst_offset, dst_stride;
GLuint dst_x, dst_y, dst_stride;
if (unpack->BufferObj->Name == 0 ||
intel->ctx._ImageTransferState ||
@@ -279,13 +279,14 @@ try_pbo_zcopy(struct intel_context *intel,
else
src_stride = width;
dst_offset = intel_miptree_image_offset(intelImage->mt,
intelImage->face,
intelImage->level);
intel_miptree_get_image_offset(intelImage->mt, intelImage->level,
intelImage->face, 0,
&dst_x, &dst_y);
dst_stride = intelImage->mt->pitch;
if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) {
if (src_stride != dst_stride || dst_x != 0 || dst_y != 0 ||
src_offset != 0) {
DBG("%s: failure 2\n", __FUNCTION__);
return GL_FALSE;
}

View File

@@ -1578,13 +1578,6 @@ static void r200ClearStencil( GLcontext *ctx, GLint s )
* Window position and viewport transformation
*/
/*
* To correctly position primitives:
*/
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
/**
* Called when window size or position changes or viewport or depth range
* state is changed. We update the hardware viewport state here.
@@ -1609,9 +1602,9 @@ void r200UpdateWindow( GLcontext *ctx )
}
float_ui32_type sx = { v[MAT_SX] };
float_ui32_type tx = { v[MAT_TX] + xoffset + SUBPIXEL_X };
float_ui32_type tx = { v[MAT_TX] + xoffset };
float_ui32_type sy = { v[MAT_SY] * y_scale };
float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias + SUBPIXEL_Y };
float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias };
float_ui32_type sz = { v[MAT_SZ] * depthScale };
float_ui32_type tz = { v[MAT_TZ] * depthScale };
@@ -1680,8 +1673,8 @@ void r200UpdateViewportOffset( GLcontext *ctx )
float_ui32_type tx;
float_ui32_type ty;
tx.f = v[MAT_TX] + xoffset + SUBPIXEL_X;
ty.f = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
tx.f = v[MAT_TX] + xoffset;
ty.f = (- v[MAT_TY]) + yoffset;
if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != tx.ui32 ||
rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != ty.ui32 )

View File

@@ -374,11 +374,21 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
if (screen->chip_family >= CHIP_FAMILY_RV515) {
ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS;
ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */
ctx->Const.FragmentProgram.MaxNativeParameters = R500_PFS_NUM_CONST_REGS;
ctx->Const.FragmentProgram.MaxNativeAluInstructions = R500_PFS_MAX_INST;
ctx->Const.FragmentProgram.MaxNativeTexInstructions = R500_PFS_MAX_INST;
ctx->Const.FragmentProgram.MaxNativeInstructions = R500_PFS_MAX_INST;
ctx->Const.FragmentProgram.MaxNativeTexIndirections = R500_PFS_MAX_INST;
/* The hardware limits are higher than this,
* but the non-KMS DRM interface artificially limits us
* to this many instructions.
*
* We could of course work around it in the KMS path,
* but it would be a mess, so it seems wiser
* to leave it as is. Going forward, the Gallium driver
* will not be subject to these limitations.
*/
ctx->Const.FragmentProgram.MaxNativeParameters = 255;
ctx->Const.FragmentProgram.MaxNativeAluInstructions = 255;
ctx->Const.FragmentProgram.MaxNativeTexInstructions = 255;
ctx->Const.FragmentProgram.MaxNativeInstructions = 255;
ctx->Const.FragmentProgram.MaxNativeTexIndirections = 255;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0;
} else {
ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS;

View File

@@ -239,6 +239,19 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog
rewriteFog(&compiler, fp);
r3xx_compile_fragment_program(&compiler);
if (compiler.is_r500) {
/* We need to support the non-KMS DRM interface, which
* artificially limits the number of instructions and
* constants which are available to us.
*
* See also the comment in r300_context.c where we
* set the MAX_NATIVE_xxx values.
*/
if (fp->code.code.r500.inst_end >= 255 || fp->code.constants.Count > 255)
rc_error(&compiler.Base, "Program is too big (upgrade to r300g to avoid this limitation).\n");
}
fp->error = compiler.Base.Error;
fp->InputsRead = compiler.Base.Program.InputsRead;

View File

@@ -225,10 +225,10 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t)
if (t->image_override && t->bo)
return;
t->pp_txsize = (((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT)
| ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)
| ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT)
| ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT));
t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT)))
| ((R300_TX_HEIGHTMASK_MASK & ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)))
| ((R300_TX_DEPTHMASK_MASK & ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT)))
| ((R300_TX_MAX_MIP_LEVEL_MASK & ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT))));
t->tile_bits = 0;
@@ -248,8 +248,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t)
if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
if (firstImage->Width > 2048)
t->pp_txpitch |= R500_TXWIDTH_BIT11;
else
t->pp_txpitch &= ~R500_TXWIDTH_BIT11;
if (firstImage->Height > 2048)
t->pp_txpitch |= R500_TXHEIGHT_BIT11;
else
t->pp_txpitch &= ~R500_TXHEIGHT_BIT11;
}
}
@@ -479,16 +483,20 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
break;
}
pitch_val--;
t->pp_txsize = ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT) |
((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT);
t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT)))
| ((R300_TX_HEIGHTMASK_MASK & ((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT))));
t->pp_txsize |= R300_TX_SIZE_TXPITCH_EN;
t->pp_txpitch |= pitch_val;
if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
if (rb->base.Width > 2048)
t->pp_txpitch |= R500_TXWIDTH_BIT11;
else
t->pp_txpitch &= ~R500_TXWIDTH_BIT11;
if (rb->base.Height > 2048)
t->pp_txpitch |= R500_TXHEIGHT_BIT11;
else
t->pp_txpitch &= ~R500_TXHEIGHT_BIT11;
}
t->validated = GL_TRUE;
_mesa_unlock_texture(radeon->glCtx, texObj);

View File

@@ -62,12 +62,6 @@ static int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_progra
}
}
if (vp->code.constants.Count * 4 > VSF_MAX_FRAGMENT_LENGTH) {
/* Should have checked this earlier... */
fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
_mesa_exit(-1);
}
for(i = 0; i < vp->code.constants.Count; ++i) {
const float * src = 0;
const struct rc_constant * constant = &vp->code.constants.Constants[i];
@@ -281,6 +275,11 @@ static struct r300_vertex_program *build_program(GLcontext *ctx,
}
r3xx_compile_vertex_program(&compiler);
if (vp->code.constants.Count > ctx->Const.VertexProgram.MaxParameters) {
rc_error(&compiler.Base, "Program exceeds constant buffer size limit\n");
}
vp->error = compiler.Base.Error;
vp->Base->Base.InputsRead = vp->code.InputsRead;
@@ -334,7 +333,6 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx)
#define bump_vpu_count(ptr, new_count) do { \
drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr)); \
int _nc=(new_count)/4; \
assert(_nc < 256); \
if(_nc>_p->vpu.count)_p->vpu.count=_nc; \
} while(0)

View File

@@ -254,7 +254,7 @@ static int r600_cs_process_relocs(struct radeon_cs *cs,
relocs = (struct r600_cs_reloc_legacy *)cs->relocs;
restart:
for (i = 0; i < cs->crelocs; i++) {
uint32_t soffset, eoffset, asicoffset;
uint32_t soffset, eoffset;
r = radeon_bo_legacy_validate(relocs[i].base.bo,
&soffset, &eoffset);
@@ -262,24 +262,12 @@ restart:
goto restart;
}
if (r) {
fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n",
fprintf(stderr, "invalid bo(%p) [0x%08X, 0x%08X]\n",
relocs[i].base.bo, soffset, eoffset);
return r;
}
asicoffset = soffset;
for (j = 0; j < relocs[i].cindices; j++) {
if (asicoffset >= eoffset) {
/* radeon_bo_debug(relocs[i].base.bo, 12); */
fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n",
relocs[i].base.bo, soffset, eoffset);
fprintf(stderr, "above end: %p 0x%08X 0x%08X\n",
relocs[i].base.bo,
cs->packets[relocs[i].indices[j]],
eoffset);
exit(0);
return -EINVAL;
}
/* pkt3 nop header in ib chunk */
cs->packets[relocs[i].reloc_indices[j]] = 0xC0001000;
/* reloc index in ib chunk */
@@ -287,7 +275,7 @@ restart:
}
/* asic offset in reloc chunk */ /* see alex drm r600_nomm_relocate */
reloc_chunk[offset_dw] = asicoffset;
reloc_chunk[offset_dw] = soffset;
reloc_chunk[offset_dw + 3] = 0;
offset_dw += 4;

View File

@@ -362,6 +362,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual,
(&r600->radeon.optionCache, "disable_stencil_two_side"))
_mesa_disable_extension(ctx, "GL_EXT_stencil_two_side");
#if 0
if (r600->radeon.glCtx->Mesa_DXTn
&& !driQueryOptionb(&r600->radeon.optionCache, "disable_s3tc")) {
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
@@ -371,6 +372,9 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual,
{
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
}
#else
_mesa_disable_extension(ctx, "GL_ARB_texture_compression");
#endif
radeon_fbo_init(&r600->radeon);
radeonInitSpanFuncs( ctx );

View File

@@ -721,7 +721,9 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
struct gl_texture_object *tObj =
_mesa_lookup_texture(rmesa->radeon.glCtx, texname);
radeonTexObjPtr t = radeon_tex_obj(tObj);
uint32_t pitch_val, size;
int firstlevel = t->mt ? t->mt->firstLevel : 0;
const struct gl_texture_image *firstImage;
uint32_t pitch_val, size, row_align, bpp;
if (!tObj)
return;
@@ -731,7 +733,13 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
if (!offset)
return;
size = pitch;//h * w * (depth / 8);
bpp = depth / 8;
if (bpp == 3)
bpp = 4;
firstImage = t->base.Image[0][firstlevel];
row_align = rmesa->radeon.texture_row_align - 1;
size = ((firstImage->Width * bpp + row_align) & ~row_align) * firstImage->Height;
if (t->bo) {
radeon_bo_unref(t->bo);
t->bo = NULL;

View File

@@ -336,7 +336,8 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm)
switch (pAsm->D.dst.opcode)
{
case SQ_OP2_INST_ADD:
case SQ_OP2_INST_ADD:
case SQ_OP2_INST_KILLGT:
case SQ_OP2_INST_MUL:
case SQ_OP2_INST_MAX:
case SQ_OP2_INST_MIN:
@@ -354,9 +355,9 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm)
return 2;
case SQ_OP2_INST_MOV:
case SQ_OP2_INST_MOVA_FLOOR:
case SQ_OP2_INST_FRACT:
case SQ_OP2_INST_FLOOR:
case SQ_OP2_INST_KILLGT:
case SQ_OP2_INST_EXP_IEEE:
case SQ_OP2_INST_LOG_CLAMPED:
case SQ_OP2_INST_LOG_IEEE:
@@ -1180,8 +1181,10 @@ GLboolean tex_src(r700_AssemblerBase *pAsm)
case PROGRAM_INPUT:
switch (pILInst->SrcReg[0].Index)
{
case FRAG_ATTRIB_WPOS:
case FRAG_ATTRIB_COL0:
case FRAG_ATTRIB_COL1:
case FRAG_ATTRIB_FOGC:
case FRAG_ATTRIB_TEX0:
case FRAG_ATTRIB_TEX1:
case FRAG_ATTRIB_TEX2:
@@ -1194,7 +1197,16 @@ GLboolean tex_src(r700_AssemblerBase *pAsm)
pAsm->S[0].src.reg =
pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index];
pAsm->S[0].src.rtype = SRC_REG_INPUT;
break;
break;
case FRAG_ATTRIB_FACE:
fprintf(stderr, "FRAG_ATTRIB_FACE unsupported\n");
break;
case FRAG_ATTRIB_PNTC:
fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n");
break;
case FRAG_ATTRIB_VAR0:
fprintf(stderr, "FRAG_ATTRIB_VAR0 unsupported\n");
break;
}
break;
}
@@ -2053,7 +2065,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm)
}
//other bits
alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP;
alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_AR_X;
if( (is_single_scalar_operation == GL_TRUE)
|| (GL_TRUE == bSplitInst) )
@@ -2387,6 +2399,35 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm)
return GL_TRUE;
}
GLboolean assemble_ARL(r700_AssemblerBase *pAsm)
{ /* TODO: ar values dont' persist between clauses */
if( GL_FALSE == checkop1(pAsm) )
{
return GL_FALSE;
}
pAsm->D.dst.opcode = SQ_OP2_INST_MOVA_FLOOR;
setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE);
pAsm->D.dst.rtype = DST_REG_TEMPORARY;
pAsm->D.dst.reg = 0;
pAsm->D.dst.writex = 0;
pAsm->D.dst.writey = 0;
pAsm->D.dst.writez = 0;
pAsm->D.dst.writew = 0;
if( GL_FALSE == assemble_src(pAsm, 0, -1) )
{
return GL_FALSE;
}
if( GL_FALSE == next_ins(pAsm) )
{
return GL_FALSE;
}
return GL_TRUE;
}
GLboolean assemble_BAD(char *opcode_str)
{
radeon_error("Not yet implemented instruction (%s)\n", opcode_str);
@@ -2508,7 +2549,7 @@ GLboolean assemble_DOT(r700_AssemblerBase *pAsm)
}
else if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_DPH)
{
onecomp_PVSSRC(&(pAsm->S[1].src), 3);
onecomp_PVSSRC(&(pAsm->S[0].src), 3);
}
if ( GL_FALSE == next_ins(pAsm) )
@@ -2617,15 +2658,15 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm)
GLboolean assemble_KIL(r700_AssemblerBase *pAsm)
{
/* TODO: doc says KILL has to be last(end) ALU clause */
checkop1(pAsm);
pAsm->D.dst.opcode = SQ_OP2_INST_KILLGT;
if ( GL_FALSE == assemble_dst(pAsm) )
{
return GL_FALSE;
}
setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE);
pAsm->D.dst.rtype = DST_REG_TEMPORARY;
pAsm->D.dst.reg = 0;
pAsm->D.dst.writex = 0;
pAsm->D.dst.writey = 0;
pAsm->D.dst.writez = 0;
@@ -2638,19 +2679,10 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm)
setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0);
noneg_PVSSRC(&(pAsm->S[0].src));
pAsm->S[1].src.rtype = SRC_REG_TEMPORARY;
if(PROGRAM_TEMPORARY == pAsm->pILInst[pAsm->uiCurInst].DstReg.File)
if ( GL_FALSE == assemble_src(pAsm, 0, 1) )
{
pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].DstReg.Index + pAsm->starting_temp_register_number;
return GL_FALSE;
}
else
{ //PROGRAM_OUTPUT
pAsm->S[1].src.reg = pAsm->uiFP_OutputMap[pAsm->pILInst[pAsm->uiCurInst].DstReg.Index];
}
setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE);
noswizzle_PVSSRC(&(pAsm->S[1].src));
if ( GL_FALSE == next_ins(pAsm) )
{
@@ -2908,6 +2940,7 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm)
pAsm->S[0].src.rtype = srcType;
pAsm->S[0].src.reg = srcReg;
setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE);
swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X);
pAsm->S[1].src.rtype = SRC_REG_TEMPORARY;
pAsm->S[1].src.reg = tmp;
setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE);
@@ -3809,8 +3842,7 @@ GLboolean AssembleInstr(GLuint uiNumberInsts,
break;
case OPCODE_ARL:
radeon_error("Not yet implemented instruction OPCODE_ARL \n");
//if ( GL_FALSE == assemble_BAD("ARL") )
if ( GL_FALSE == assemble_ARL(pR700AsmCode) )
return GL_FALSE;
break;
case OPCODE_ARR:
@@ -4155,6 +4187,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode,
GLbitfield OutputsWritten)
{
unsigned int unBit;
GLuint export_count = 0;
if(pR700AsmCode->depth_export_register_number >= 0)
{
@@ -4176,6 +4209,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode,
{
return GL_FALSE;
}
export_count++;
}
unBit = 1 << FRAG_RESULT_DEPTH;
if(OutputsWritten & unBit)
@@ -4189,8 +4223,15 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode,
{
return GL_FALSE;
}
export_count++;
}
/* Need to export something, otherwise we'll hang
* results are undefined anyway */
if(export_count == 0)
{
Process_Export(pR700AsmCode, SQ_EXPORT_PIXEL, 0, 1, 0, GL_FALSE);
}
if(pR700AsmCode->cf_last_export_ptr != NULL)
{
pR700AsmCode->cf_last_export_ptr->m_Word1.f.cf_inst = SQ_CF_INST_EXPORT_DONE;

View File

@@ -461,6 +461,7 @@ GLboolean next_ins(r700_AssemblerBase *pAsm);
GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode);
GLboolean assemble_ABS(r700_AssemblerBase *pAsm);
GLboolean assemble_ADD(r700_AssemblerBase *pAsm);
GLboolean assemble_ARL(r700_AssemblerBase *pAsm);
GLboolean assemble_BAD(char *opcode_str);
GLboolean assemble_CMP(r700_AssemblerBase *pAsm);
GLboolean assemble_COS(r700_AssemblerBase *pAsm);

View File

@@ -794,8 +794,7 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom)
BATCH_LOCALS(&context->radeon);
radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__);
BEGIN_BATCH_NO_AUTOSTATE(23);
R600_OUT_BATCH_REGVAL(DB_HTILE_DATA_BASE, r700->DB_HTILE_DATA_BASE.u32All);
BEGIN_BATCH_NO_AUTOSTATE(17);
R600_OUT_BATCH_REGSEQ(DB_STENCIL_CLEAR, 2);
R600_OUT_BATCH(r700->DB_STENCIL_CLEAR.u32All);
@@ -808,7 +807,6 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom)
R600_OUT_BATCH(r700->DB_RENDER_CONTROL.u32All);
R600_OUT_BATCH(r700->DB_RENDER_OVERRIDE.u32All);
R600_OUT_BATCH_REGVAL(DB_HTILE_SURFACE, r700->DB_HTILE_SURFACE.u32All);
R600_OUT_BATCH_REGVAL(DB_ALPHA_TO_MASK, r700->DB_ALPHA_TO_MASK.u32All);
END_BATCH();
@@ -1239,7 +1237,7 @@ void r600InitAtoms(context_t *context)
context->radeon.hw.atomlist.name = "atom-list";
ALLOC_STATE(sq, always, 34, r700SendSQConfig);
ALLOC_STATE(db, always, 23, r700SendDBState);
ALLOC_STATE(db, always, 17, r700SendDBState);
ALLOC_STATE(stencil, always, 4, r700SendStencilState);
ALLOC_STATE(db_target, always, 12, r700SendDepthTargetState);
ALLOC_STATE(sc, always, 15, r700SendSCState);

View File

@@ -135,15 +135,19 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp,
{
GLuint i, j;
GLint * puiTEMPwrites;
GLint * puiTEMPreads;
struct prog_instruction * pILInst;
InstDeps *pInstDeps;
struct prog_instruction * texcoord_DepInst;
GLint nDepInstID;
puiTEMPwrites = (GLint*) MALLOC(sizeof(GLuint)*mesa_fp->Base.NumTemporaries);
puiTEMPreads = (GLint*) MALLOC(sizeof(GLuint)*mesa_fp->Base.NumTemporaries);
for(i=0; i<mesa_fp->Base.NumTemporaries; i++)
{
puiTEMPwrites[i] = -1;
puiTEMPreads[i] = -1;
}
pInstDeps = (InstDeps*)MALLOC(sizeof(InstDeps)*mesa_fp->Base.NumInstructions);
@@ -167,6 +171,11 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp,
{
//Set dep.
pInstDeps[i].nSrcDeps[j] = puiTEMPwrites[pILInst->SrcReg[j].Index];
//Set first read
if(puiTEMPreads[pILInst->SrcReg[j].Index] < 0 )
{
puiTEMPreads[pILInst->SrcReg[j].Index] = i;
}
}
else
{
@@ -177,8 +186,6 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp,
fp->r700AsmCode.pInstDeps = pInstDeps;
FREE(puiTEMPwrites);
//Find dep for tex inst
for(i=0; i<mesa_fp->Base.NumInstructions; i++)
{
@@ -203,9 +210,25 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp,
{ //... other deps?
}
}
// make sure that we dont overwrite src used earlier
nDepInstID = puiTEMPreads[pILInst->DstReg.Index];
if(nDepInstID < i)
{
pInstDeps[i].nDstDep = puiTEMPreads[pILInst->DstReg.Index];
texcoord_DepInst = &(mesa_fp->Base.Instructions[nDepInstID]);
if(GL_TRUE == IsAlu(texcoord_DepInst->Opcode) )
{
pInstDeps[nDepInstID].nDstDep = i;
}
}
}
}
FREE(puiTEMPwrites);
FREE(puiTEMPreads);
return GL_TRUE;
}
@@ -251,7 +274,15 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp,
number_of_colors_exported--;
}
fp->r700Shader.exportMode = number_of_colors_exported << 1 | z_enabled;
/* illegal to set this to 0 */
if(number_of_colors_exported || z_enabled)
{
fp->r700Shader.exportMode = number_of_colors_exported << 1 | z_enabled;
}
else
{
fp->r700Shader.exportMode = (1 << 1);
}
fp->translated = GL_TRUE;
@@ -341,6 +372,11 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx)
SETbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit);
SETbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit);
}
else
{
CLEARbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit);
CLEARbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit);
}
ui = (unNumOfReg < ui) ? ui : unNumOfReg;

View File

@@ -40,6 +40,24 @@
#include "r700_vertprog.h"
static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *cache)
{
struct r700_vertex_program *tmp, *vp = cache->progs;
while (vp) {
tmp = vp->next;
/* Release DMA region */
r600DeleteShader(ctx, vp->shaderbo);
/* Clean up */
Clean_Up_Assembler(&(vp->r700AsmCode));
Clean_Up_Shader(&(vp->r700Shader));
_mesa_reference_vertprog(ctx, &vp->mesa_program, NULL);
_mesa_free(vp);
vp = tmp;
}
}
static struct gl_program *r700NewProgram(GLcontext * ctx,
GLenum target,
GLuint id)
@@ -84,8 +102,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx,
static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog)
{
struct r700_vertex_program_cont * vpc;
struct r700_vertex_program *vp, *tmp;
struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog;
struct r700_fragment_program * fp;
radeon_print(RADEON_SHADER, RADEON_VERBOSE,
@@ -95,20 +112,7 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog)
{
case GL_VERTEX_STATE_PROGRAM_NV:
case GL_VERTEX_PROGRAM_ARB:
vpc = (struct r700_vertex_program_cont*)prog;
vp = vpc->progs;
while (vp) {
tmp = vp->next;
/* Release DMA region */
r600DeleteShader(ctx, vp->shaderbo);
/* Clean up */
Clean_Up_Assembler(&(vp->r700AsmCode));
Clean_Up_Shader(&(vp->r700Shader));
_mesa_free(vp);
vp = tmp;
}
freeVertProgCache(ctx, vpc);
break;
case GL_FRAGMENT_PROGRAM_NV:
case GL_FRAGMENT_PROGRAM_ARB:
@@ -131,7 +135,24 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog)
static void
r700ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog)
{
struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog;
struct r700_fragment_program * fp = (struct r700_fragment_program*)prog;
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
freeVertProgCache(ctx, vpc);
vpc->progs = NULL;
break;
case GL_FRAGMENT_PROGRAM_ARB:
r600DeleteShader(ctx, fp->shaderbo);
Clean_Up_Assembler(&(fp->r700AsmCode));
Clean_Up_Shader(&(fp->r700Shader));
fp->translated = GL_FALSE;
fp->loaded = GL_FALSE;
fp->shaderbo = NULL;
break;
}
}
static GLboolean r700IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog)

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