Compare commits

...

187 Commits

Author SHA1 Message Date
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
Robert Noland
d09941c8cc Fix build on non GLIBC platforms (FreeBSD at least)
Build was broken by commit 9666529b5a

I'm not certain that this is entirely the correct fix since the demo
from bug #23774 seemed to work before the commit that broke the build.

Signed-off-by: Robert Noland <rnoland@2hip.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-09-28 09:48:45 -06:00
Brian Paul
fc613848e6 docs: list additional 7.5.2 bug fixes 2009-09-28 09:43:42 -06:00
Brian Paul
c7d0f0b46c docs: document gallium mipmap generation fix 2009-09-28 09:38:50 -06:00
Brian Paul
c7fddaf612 st/mesa: fix st_generate_mipmap() issues
The main issue is we didn't always have a gallium texture object with
enough space to store the to-be-generated mipmap levels.  When that's
the case, allocate a new gallium texture and use st_texure_finalize()
to copy images from the old texture to the new one.

We also had the baseLevel parameter to st_render_mipmap() wrong.
2009-09-28 09:37:16 -06:00
Brian Paul
e3a6f57ad6 st/mesa: fix/simplify st_texture_object::lastLevel calculation
Don't compute the st_texture_object::lastLevel field based on the texture
filters.  Use the _MaxLevel value that core Mesa computes for us.
When called from the GenerateMipmap path, we'll use the lastLevel field
as-is.
2009-09-28 09:35:08 -06:00
Brian Paul
41d0606b7f gallium/util: add sanity check assertions 2009-09-28 09:35:04 -06:00
Eric Anholt
126d62edd1 i915: Fix GetBufferSubData in the case of a system-memory BO.
Bug #23760 (crashes in wine)
2009-09-24 20:04:42 -07:00
Vinson Lee
1730b8db12 softpipe: Increase GL_MAX_3D_TEXTURE_SIZE to 256. 2009-09-24 15:59:57 -06:00
Brian Paul
60b152a1b3 mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning
At the time of the enable there may not be a Z buffer, but one
may be attached to the FBO later.
2009-09-24 14:24:14 -06:00
Brian Paul
adfa778c8e mesa: remove rgbMode check in enable_texture()
If the currently bound FBO isn't yet validated it's possible for
rgbMode to be zero so we'll lose the texture enable.
This could fix some FBO rendering glitches, but I don't know of
any specific instances.
2009-09-24 14:19:06 -06:00
Brian Paul
2acd5de226 swrast: add lod bias when texture sampling
Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1.  But the LOD still
seems off by -1 or so.
May be an issue with the params passed to _swrast_compute_lambda()
2009-09-23 13:36:44 -06:00
Brian Paul
890f37d4d9 mesa: don't bias LOD in shader interpreter; do it in swrast 2009-09-23 13:36:44 -06:00
Brian Paul
ad935c3f47 swrast: fix typo in partial derivatives parameter passing 2009-09-23 13:36:43 -06:00
Keith Whitwell
be66ff51ec st/mesa: trim calculated userbuffer size
In get_array_bounds we were previously defining a user buffer sized as
(nr_vertices * stride).  The trouble is that if the vertex data
occupies less than stride bytes, the extra tailing (stride - size)
bytes may extend outside the memory actually allocated by the app and
caused a segfault.

To fix this, define a the buffer bounds to be:

   ptr .. ptr + (nr-1)*stride + element_size
2009-09-23 18:55:46 +01:00
Brian Paul
bc75464760 glx: include string.h to silence missing memset() prototype warning 2009-09-22 13:19:15 -06:00
Brian Paul
52cadf7592 mesa: fix error message text 2009-09-22 13:19:11 -06:00
Tormod Volden
e857303305 GLX: Warn only once about applications calling GLX 1.3 functions
The warnings introduced in 1f309c40b8
would pour out generously from some applications. This patch adds a
"warn once" wrapper macro, heavily inspired by
src/mesa/drivers/dri/r600/radeon_debug.h

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-09-21 15:29:52 -07:00
Eric Anholt
2b83483fb4 intel: Mark the FBO as incomplete if there's no intel_renderbuffer for it.
This happens to rendering with textures with a border, which had resulted
in a segfault on dereferencing the irb.

(cherry-picked from commit 8bba183b9e)
2009-09-21 10:02:38 -06:00
Brian Paul
5a0b29050f softpipe: Fix cube face selection.
If arx and ary are equal, we still want to choose from one of them,
and not arz.

(cherry picked from commit de685b37a9)
2009-09-21 08:36:05 -06:00
Brian Paul
077e3de989 swrast: fix cube face selection
If arx and ary are equal, we still want to choose from one of them,
and not arz.

This is the same as Michal's softpipe fix.
2009-09-21 08:36:05 -06:00
Michel Dänzer
999592745f intel: Fix crash in intel_flush().
Since commit 2921a2555d ('intel: Deassociated
drawables from private context struct in intelUnbindContext'),
intel->driDrawable may be NULL in intel_flush().
2009-09-21 10:28:37 +02:00
Nicolai Hähnle
c4ce6f6a7c mesa/st: Initialize format bits of framebuffer renderbuffers
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-20 16:54:40 +02:00
Ian Romanick
9666529b5a glx: Use initstate_r / random_r instead of corrupting global random number state
Previously srandom and random were used.  This cause the global random
number generator state to be modified.  This caused problems for
applications that called srandom before calling into GLX.  By using
local state the global state is left unmodified.

This should fix bug #23774.
2009-09-16 16:43:50 -07:00
Brian Paul
08d39251a7 st/mesa: fix some incorrect branching/clean-up code in TexImage functions
We need to be sure to call the _mesa_unmap_teximage_pbo() function if we
called _mesa_validate_pbo_teximage().
2009-09-16 13:07:15 -06:00
Brian Paul
cfa1a0a609 st/mesa: fix texture memory allocation bug
The following example caused an incorrect GL_OUT_OF_MEMORY error to be
raised in glTexSubImage2D:

   glTexImage2D(level=0, width=32, height=32, pixels=NULL);
   glTexImage2D(level=0, width=64, height=64, pixels=NULL);
   glTexSubImage2D(level=0, pixels!=NULL);

The second glTexImage2D() call needs to cause the first image to be
deallocated then reallocated at the new size.  This was not happening
because we were testing for pixels==NULL too early.
2009-09-16 12:57:26 -06:00
Ian Romanick
2921a2555d intel: Deassociated drawables from private context struct in intelUnbindContext
The generic DRI infrastructure makes sure that __DRIcontextRec::driDrawablePriv
and __DRIcontextRec::driReadablePriv are set to NULL after unbinding a
context.  However, the intel_context structure keeps cached copies of
these pointers.  If these cached pointers are not NULLed and the
drawable is actually destroyed after unbinding the context (typically
by way of glXDestroyWindow), freed memory will be dereferenced in
intelDestroyContext.

This should fix bug #23418.
2009-09-16 07:39:58 -07:00
Brian Paul
d9ddbc3f47 docs: glUniform functions are now compiled into display lists 2009-09-15 15:12:29 -06:00
Brian Paul
41fff1b9a1 mesa: compile glUniformMatrix() functions into display lists
I believe this is the last of the shader-related functions that needed
display list treatment.
2009-09-15 15:10:29 -06:00
Brian Paul
6681981fe1 mesa: implement more glUniform display list functions 2009-09-15 14:56:55 -06:00
Brian Paul
3ad108b77f docs: document glUseProgram display list fix 2009-09-15 14:38:52 -06:00
Brian Paul
f42c66c138 mesa: compile glUniform4f() into display lists
Note: there are more glUniform functions to compile...
2009-09-15 14:37:45 -06:00
Brian Paul
81de9d68f7 mesa: compile glUseProgram/glUseProgramObjectARB into display lists
Fixes bug 23746
2009-09-15 14:37:45 -06:00
Ian Romanick
1f309c40b8 GLX: Complain when buggy applications call GLX 1.3 functions. 2009-09-15 13:12:22 -07:00
Brian Paul
799631acb1 progs/vp: print program and error info when program does not compile 2009-09-14 17:48:17 -06:00
Brian Paul
ac3c8e3b53 glsl: added some link debug code (disabled) 2009-09-14 17:32:03 -06:00
Brian Paul
3129b2403e docs: document linker/preprocessor bug fix 2009-09-14 17:27:47 -06:00
Brian Paul
b8b774c775 glsl: remove extra #version directives from concatenated shader sources
When we concatenate shaders to do our form of poor-man linking, if there's
multiple #version directives, preprocessing fails.  This change disables
the extra #version directives by changing the first two chars to //.

This should help with some Wine issues such as bug 23946.
2009-09-14 17:24:25 -06:00
Thierry Vignaud
1402ea8f39 configure: fix comment 2009-09-14 11:48:51 -06:00
Dan Nicholson
9c8b69302c Use CFLAGS as HOST_CFLAGS by default
Unless we're cross compiling, the HOST_CFLAGS should be the same as the
normal CFLAGS. This allows the x86 and x86_64 asm to be built correctly
with a native compiler using -m32/-m64.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-09-12 09:35:43 -07:00
Vinson Lee
0fa1692f14 mesa: raise GL_INVALID_ENUM not GL_INVALID_VALUE for glTexParamter errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-09-11 08:04:37 -06:00
Brian Paul
4d9bbabb83 docs: document Gallium glDrawPixels(GL_STENCIL_INDEX) fix 2009-09-10 14:15:07 -06:00
Brian Paul
3f4d776199 softpipe: minor indentation fix 2009-09-10 14:14:18 -06:00
Brian Paul
988db64119 softpipe: set dirty_render_cache in softpipe_clear()
This fixes a bug seen when doing a glDrawPixels(GL_STENCIL_INDEX) right
after a glClear().  The check-for-flush test was failing because we
didn't set the dirty_render_cache flag in softpipe_clear().  So we saw
stale data when we mapped the stencil buffer.
2009-09-10 14:11:41 -06:00
Brian Paul
79a3e298c5 docs: initial 7.5.2 release notes page 2009-09-10 12:50:08 -06:00
Zhenyu Wang
2dd3da3a4a intel: add B43 chipset support
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

Hopefully this will be one of the last cherry-picks.

(cherry picked from commit ca246dd186)
2009-09-10 11:18:41 -07:00
Vinson Lee
d27d659043 scons: Set default_dri to no for Mac OS.
Mac OS does not have libdrm.
2009-09-09 08:21:07 -06:00
Brian Paul
42943a4cf9 mesa: bump version to 7.5.2
I'm not 100% sure there'll be a 7.5.2 release, but just in case.
2009-09-08 14:45:27 -06:00
Brian Paul
8de625c7cf i965: fix incorrect test for vertex position attribute 2009-09-08 12:21:42 -06:00
Brian Paul
18bdb6e712 egl: also use X types for building on Apple/MacOS X
See bug 20413.
2009-09-08 09:20:43 -06:00
Peter Hutterer
bf19638a00 prog/glsl: fix Makefile for samplers_array.
The rule added in 488b3c4d1b does not use the
right INCDIR, breaking the build when GL isn't installed in the default include
paths.

7.5 branch only fix, already fixed in master by rewriting the Makefile
(ceb9459ed5)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-07 12:37:54 +10:00
Eric Anholt
b2cba25f9e i965: Fix warnings in intel_pixel_read.c.
(cherry picked from commit c80ce5ac90)
2009-09-04 14:41:33 -07:00
Eric Anholt
cf820a045f intel: Also get the DRI2 front buffer when doing front buffer reading.
(cherry picked from commit df70d3049a)
2009-09-04 14:40:21 -07:00
Eric Anholt
2855ee82c6 intel: Update Mesa state before span setup in glReadPixels.
We could have mapped the wrong set of draw buffers.  Noticed while looking
into a DRI2 glean ReadPixels issue.
(cherry picked from commit afc981ee46)
2009-09-04 14:40:15 -07:00
Eric Anholt
04081a164c intel: Move intel_pixel_read.c to shared for use with i965.
(cherry picked from commit dcfe0d66bf)
2009-09-04 14:40:12 -07:00
Eric Anholt
1d1dfc96c4 i965: Add missing state dependency of sf_unit on _NEW_BUFFERS.
(cherry picked from commit 99174e7630)
2009-09-04 14:12:37 -07:00
Eric Anholt
a9504edee3 intel: Align cubemap texture height to its padding requirements.
(cherry picked from commit a70e131584)
(cherry picked from commit 29e51c3872)
2009-09-04 14:12:37 -07:00
Eric Anholt
945d34e88a intel: Align untiled region height to 2 according to 965 docs.
This may or may not be required pre-965, but it doesn't seem unlikely, and
I'd rather be safe.
(cherry picked from commit b053474378)
2009-09-04 14:12:36 -07:00
Eric Anholt
94d3b832cc i965: Fix source depth reg setting for FSes reading and writing to depth.
For some IZ setups, we'd forget to account for the source depth register
being present, so we'd both read the wrong reg, and write output depth to
the wrong reg.

Bug #22603.
(cherry picked from commit f44916414e)
2009-09-04 14:12:36 -07:00
Eric Anholt
8c764d5c34 i965: Respect CondSwizzle in OPCODE_IF.
Fixes piglit glsl-vs-if-bool and progs/glsl/twoside, and will likely be
useful for the looping code.

Bug #18992
(cherry picked from commit 78c022acd0)
(cherry picked from commit 63d7a2f53f)
2009-09-04 14:12:36 -07:00
Brian Paul
a0b7850f1d i965: asst clean-ups, etc in brw_vs_emit()
(cherry picked from commit fd7d764514)
2009-09-04 14:12:36 -07:00
Eric Anholt
3d6c73513c i965: Emit conditional code updates as required for GLSL VS if statements.
Previously, we'd be branching based on whatever condition code happened to be
laying around.
(cherry picked from commit 7007f8b352)
2009-09-04 14:12:36 -07:00
Eric Anholt
83e6c67363 i965: Spell "conditional" correctly. 2009-09-04 14:12:36 -07:00
Eric Anholt
f396263651 i965: Fix RECT shadow sampling by not losing the other texcoords.
Bug #20821
(cherry picked from commit 191e028de2)
2009-09-04 14:12:36 -07:00
Eric Anholt
63b3fa2bce i965: Assert that the offset in the VBO is below the VBO size.
This avoids sending a bad buffer address to the GPU due to programmer error,
and is permitted by the ARB_vbo spec.  Note that we still have the opportunity
to dereference past the end of the GPU, because we aren't clipping to a
correct _MaxElement, but that appears to be harder than it should be.  This
gets us the 90% solution.

Bug #19911.
(cherry picked from commit d7430d942f)
2009-09-04 14:12:36 -07:00
Eric Anholt
217af32c2d i965: Even if no VS inputs are set, still load some amount of URB as required.
See comment on Vertex URB Entry Read Length for VS_STATE.

This, combined with the previous three commits, fixes #22945.
(cherry picked from commit e340d4f986)
2009-09-04 14:12:35 -07:00
Eric Anholt
456a16491b i965: Make sure the VS URB size is big enough to fit a VF VUE.
This fix is just from code and docs inspection, but it may fix hangs on
some applications.

(cherry picked from commit e93848e595)
2009-09-04 14:12:35 -07:00
Eric Anholt
9eca0e5350 i965: Don't emit bad packets when no VBs are referenced.
It appears that sometimes Mesa (and I suppose a VS could as well) emits
a program which references no vertex data, and thus we end up with
nr_enabled == 0 even though some VBs are enabled.  We'd end up emitting
VB/VE packet headers of 0xffffffff in that case, leading to GPU hangs.

Bug #22945 (wine with an uncompiled VS)
(cherry picked from commit d1fbfd0f96)
2009-09-04 14:12:35 -07:00
Eric Anholt
7e26bdb849 i965: Calculate enabled[] and nr_enabled once and re-use the values.
The code duplication bothered me.
(cherry picked from commit 9b9cb30d12)
2009-09-04 14:12:35 -07:00
Eric Anholt
213ac4bb5d i965: Set the max index buffer address correctly according to the docs.
It's the last addressable byte, not the byte after the end of the buffer.
(cherry picked from commit b72dea5441)
2009-09-04 14:12:35 -07:00
Brian Paul
cab307ce6b i965: rename var: s/tmp/vs_inputs/
(cherry picked from commit 840c09fc71)
2009-09-04 14:12:35 -07:00
Brian Paul
1960da2e09 docs: 7.5.1 md5 sums 2009-09-03 15:49:10 -06:00
Brian Paul
7d3af894d6 docs: point to fd.o for downloads instead of SourceForge 2009-09-03 15:44:49 -06:00
Brian Paul
32156f3a11 gallium/xlib: silence unitialized var warning 2009-09-03 15:44:22 -06:00
Brian Paul
1c32caf075 gallium/xlib: silence uninitialized var warning 2009-09-03 15:23:15 -06:00
Brian Paul
67c286d20e st/mesa: silence uninitialized var warnings 2009-09-03 15:04:49 -06:00
Brian Paul
0b4e835b13 docs: prep for 7.5.1 release 2009-09-03 14:57:30 -06:00
Brian Paul
08575509e4 docs: added news entry for 7.5.1 2009-09-03 14:57:16 -06:00
Brian Paul
ccb081414b docs: update precompiled libs info 2009-09-03 14:57:04 -06:00
Brian Paul
47df7900fd docs: move SGI GLU link 2009-09-03 14:56:50 -06:00
Brian Paul
c3a0624ef0 st/mesa: fix glCopyPixels(GL_STENCIL_INDEX) inverted position
If the renderbuffer orientation is Y=0=TOP we need to invert the dstY
position.
2009-09-03 14:39:53 -06:00
Keith Whitwell
e79054cc40 st/mesa: Do GL_RGBA->GL_RGB texsubimage on hardware
State tracker currently backs GL_RGB textures with RGBA almost always.
This means we need to maintain A==1 in these textures to give correct GL_RGB
sampling results.

This change offloads the RGBA->RGB copy to hardware using the new writemask
version of u_blit_pixels.

More src/dstLogical/dstActual triples could be shifted to hardware by
this technique in future patches.
2009-09-02 18:31:48 +01:00
Keith Whitwell
de343680a3 util: add version of u_blit_pixels which takes a writemask
Values outside the writemask are set in the destination to {0,0,0,1}
2009-09-02 18:31:48 +01:00
Keith Whitwell
1d7a989b10 draw: remove unused variable 2009-09-02 18:31:47 +01:00
Brian Paul
d9b7d7875b progs/tests: re-enable exit() call
See bug 21267.
2009-09-01 08:53:34 -06:00
Brian Paul
3f785080db swrast: fix selection/feedback regression
This fixes a conform selection/feedback regression introduced by commit
8f4d66c5f8
2009-08-31 17:54:46 -06:00
Brian Paul
fcf0804c05 swrast: can't use deferred texture/shading if using KIL instruction
If the fragment program uses KIL, we have to execute it before z/stencil
testing.  Otherwise, deferred texture/shading lets us skip shading for
pixels that fail z/stencil testing.
2009-08-31 13:28:31 -06:00
Brian Paul
9f36473a8e mesa: added const qualifiers, move local var 2009-08-31 11:17:59 -06:00
Brian Paul
2241665dc6 mesa: fix saturation logic in emit_texenv()
We need to clamp/saturate after each texenv stage, not just the last one.
Fixes glean texEnv failure for softpipe (and probably other fragment program-
based drivers).
2009-08-31 11:14:16 -06:00
Brian Paul
6bf86681f5 docs: fixed glXCreateGLXPixmap() for direct rendering 2009-08-31 10:32:56 -06:00
Brian Paul
f7654faf16 docs/: document cross-compile fix 2009-08-31 10:32:14 -06:00
Marc Dietrich
a48ee529a2 mesa: fix 32bit cross compilation on a 64bit machine
When cross compiling on a 64bit machine, gen_matypes.c is build
for the host machine (64bit) but must generates code for the target
machine (32bit). This causes wrong offsets all over the place and
crashes googleearth on my machine. Solution is to add -m32 when
cross compiling.

Attached patch is compatible with linux-x86-32 and autoconf based
builds.
2009-08-31 10:32:14 -06:00
Michel Dänzer
edb1178798 glx/x11: Fix glXCreateGLXPixmap for direct rendering.
Fixes progs/xdemos/glxpixmap modified to use direct rendering.
2009-08-30 12:53:00 +02:00
José Fonseca
9399b9a0e2 util: Reset size to zero when failed to allocate buffer. 2009-08-28 12:52:31 +01:00
Brian Paul
0d7bed9f89 docs: fix selection/feedback culling bug 2009-08-27 16:50:44 -06:00
Brian Paul
8f4d66c5f8 swrast: fix incorrect tri culling in selection/feedback mode.
See bug 16866.
2009-08-27 16:50:03 -06:00
marvin24
43a064e06d mesa: direct program debug output to stderr instead of stdout 2009-08-27 09:22:51 -06:00
Brian Paul
32f95f8c17 gallium/util: added support for SRGB formats
Fixes glean/texture_srgb failure, bug #23449.
2009-08-27 09:10:38 -06:00
Brian Paul
f8ae968d28 gallium/util: added cases for SRGB formats 2009-08-27 09:09:56 -06:00
Brian Paul
babb5ba9a9 glsl: signal that the program needs to be re-translated when samplers change 2009-08-26 14:29:50 -06:00
Brian Paul
d09d03aa42 docs: document sampler array bug fix 2009-08-26 12:04:35 -06:00
Brian Paul
488b3c4d1b progs/glsl: add special Makefile rule for samplers_array 2009-08-26 11:55:15 -06:00
Brian Paul
f6d34c2058 progs/glsl: change samplers.c to better test sampler/texture indexing
Now the left half is yellow and the right half is red, with the gradients
going in opposite directions.
2009-08-26 11:53:25 -06:00
Brian Paul
04d170794a glsl: fix bug in sampler array indexing
Need to add the 'offset' parameter when indexing the parameter array.
Before, if we were setting arrays of samplers, we were actually only
setting the 0th sampler's value.

Because of how progs/glsl/samplers.c is constructed, this wasn't showing
up as a failure in the samplers_array output.
2009-08-26 11:39:31 -06:00
Brian Paul
bf7e4b10cb ARB prog: Set error instead of falling through with incorrect value
If a fragment program only parameter was queried of a vertex program
(e.g., GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB) no error would be set and
a random value would be returned.  This caused 'glxinfo -l' to show
the same values for GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB as for
GL_MAX_PROGRAM_ENV_PARAMETERS_ARB.  This is confusing and incorrect.

(cherry picked from master, commit 4bccd693a7)
2009-08-24 13:56:01 -06:00
Brian Paul
96f7b42242 docs: recent 7.5.1 bug fixes 2009-08-24 13:02:33 -06:00
Brian Paul
b5ecbbe636 xlib: fix single buffer window resize bug
When a single-buffered window was resized the new window size was never
detected.  This fix that, but there's still a bug which causes window
contents corruption for certain window sizes...
2009-08-24 12:58:49 -06:00
Brian Paul
b9b04872d5 vbo: fix divide by zero exception
Fixes bug 23489.
2009-08-24 12:44:00 -06:00
Vinson Lee
f785b35b47 glsl: Silence gcc uninitialized variable warning. 2009-08-24 11:43:02 -06:00
Brian Paul
1aba1baa62 st/mesa: flush bitmap cache if Z value changes
When adding a new bitmap to the cache we have to check if the Z value is
changing and flush first if it is.

This is a modified version of a patch from Justin Dou <justin.dou@intel.com>
2009-08-21 10:24:50 -06:00
Brian Paul
ce723d8d8b tgsi: check for SOA dependencies in SSE and PPC code generators
Fall back to interpreter for now.  This doesn't happen very often.
2009-08-20 10:34:45 -06:00
Brian Paul
4c7c294fff tgsi: handle SOA dependencies for MOV/SWZ
SOA dependencies can happen when a register is used both as a source and
destination and the source is swizzled.  For example:

MOV T, T.yxwz; would expand into:

  MOV t0, t1;
  MOV t1, t0;
  MOV t2, t3;
  MOV t3, t2;

The second instruction will produce the wrong result since we wrote to t0
in the first instruction.  We need to use an intermediate temporary to fix
this.

This will take more work to fix for all TGSI instructions.  This seems to
happen with MOV instructions more than anything else so fix that case now
and warn on others.

Fixes piglit glsl-vs-loop test (when not using SSE). See bug 23317.
2009-08-20 10:28:22 -06:00
Brian Paul
5e6d21afa4 tgsi: added tgsi_full_instruction::Flags field
Users of the parser can make use of this.
2009-08-20 10:25:55 -06:00
Brian Paul
3097d7dbf8 tgsi/ppc: we don't implement saturation modes yet 2009-08-18 17:50:52 -06:00
Brian Paul
fab17c1216 tgsi/sse: we don't implement saturation modes yet
Fixes piglit fp-generic tests/shaders/generic/lrp_sat.fp, bug 23316.
2009-08-18 17:50:00 -06:00
Brian Paul
ee0984e299 mesa: when emitting vertex program fog, set yzw=0,0,1
Fixes piglit fp-fog failure with gallium.
2009-08-18 17:39:55 -06:00
Brian Paul
e8957f4800 progs/demos: print more info in fbotexture.c 2009-08-14 17:30:32 -06:00
José Fonseca
e3bc1fb6bc gallium: Always map for READ flag when DISCARD is not set.
This prevents the driver from discarding a buffer when the whole buffer
is mapped for writing, but only a portion is effectively written.

This is a temporary fix, because WRITE shouldn't imply DISCARD.

The full fix implies using PIPE_BUFFER_USAGE_DISCARD, throughout
the code, and will go only into master.
2009-08-14 20:05:51 +01:00
José Fonseca
10430f47a4 trace: Remove space next to the class attribute of the trace. 2009-08-14 20:05:51 +01:00
José Fonseca
cdf56eb68d python/retrace: Open bz2 files correctly. 2009-08-14 20:05:51 +01:00
Brian Paul
1574b05189 docs: docs: document new --with-max-width/height config options 2009-08-14 11:24:20 -06:00
Brian Paul
a7ca80ff6a Add a FAQ about internal buffer sizes.
(cherry picked from master, commit 9a8781bd24)
2009-08-14 11:23:18 -06:00
Brian Paul
467b3d9a6f Add configure options for MAX_WIDTH/HEIGHT.
This adds two --with configure options for setting defines for
MAX_WIDTH and MAX_HEIGHT.  It's conceivably just as easy to define
these in CFLAGS manually, but this way users don't need to know
about internal Mesa details.

Patch updated by BrianP to set DEFINES, not CFLAGS.

(cherry picked from master, commit 7085dce750)
2009-08-14 11:23:00 -06:00
Brian Paul
e691b0e533 Allow external settings of MAX_WIDTH/HEIGHT.
Conditionalize MAX_WIDTH / MAX_HEIGHT defines so that users can
set them via CFLAGS.

(cherry picked from master, commit 66bc17e80e)
2009-08-14 11:22:37 -06:00
Brian Paul
3ffaa11f88 mesa: move assertions in test_attachment_completeness()
Put the assertions after the error checks.
2009-08-14 10:30:10 -06:00
Brian Paul
1e0f621b50 mesa: fix some invalid memory reads
We were passing the address of a float to functions that would deref the
pointer as an array.
2009-08-13 14:38:27 -06:00
Brian Paul
6d55fd705d progs/tests: hack a PBO/dlist test 2009-08-13 14:07:25 -06:00
Brian Paul
ecb177eaea mesa: fix warnings about locals hiding function params 2009-08-13 14:05:52 -06:00
Brian Paul
36df6a6e91 mesa: add missing PBO mapping code in unpack_image() 2009-08-13 14:00:21 -06:00
Brian Paul
ad8a6937ae main: fix some potential memory leaks
Allocate dlist images after error checking.
Record GL_OUT_OF_MEMORY when we can't make a copy of an image.
2009-08-13 13:48:36 -06:00
Brian Paul
f418d18ea6 mesa: fix some potential uninitialized memory references 2009-08-13 13:44:31 -06:00
Brian Paul
a531a5cf94 glsl: fix some uninitialized pointers 2009-08-13 13:44:01 -06:00
Keith Whitwell
1ce3f5a806 draw: cope with more primitives in draw_pipeline_run
This previously was used only for decomposed (POINT/LINE/TRI) primitives,
but for some time a full range of primitives could end up in here.

Fixes trivial/lineloop-clip on softpipe, among others.
(cherry picked from commit 87cd8a3b8a2407b30916be418ff2f95dfea5d2ad)
2009-08-13 15:56:17 +01:00
Pauli Nieminen
d80b36f64f dri: Fix problems with unitialized values in dri screen object.
This fixes crash in r200 KMS driver when pSAREA was set to 1 randomly because of memory wasn't cleared.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-07 11:24:47 -06:00
Brian Paul
9676ed27fe util: fix incorrect assertion
Check that the dest surface/format is renderable.
2009-08-06 14:58:06 -06:00
Brian Paul
98f00e8eb9 util: include u_surface.h, added comment 2009-08-06 14:54:25 -06:00
Brian Paul
24fdf8aadb util: use util_same_surface() to compare surface pointers 2009-08-06 09:47:13 -06:00
Brian Paul
ffb1f9bded util: added util_same_surface() helper function 2009-08-06 09:47:13 -06:00
Alan Hourihane
8c223e8eb6 Ensure GL_EXT_blend_equation_separate is enabled when 2.0 is enabled. 2009-08-06 16:16:55 +01:00
Brian Paul
5b3428d745 docs:fix glBlitFramebuffer() for Gallium 2009-08-05 13:50:21 -06:00
Brian Paul
a59579c983 st/mesa: implement BlitFramebuffer() for depth/stencil (incomplete)
We now handle the case of blitting Z+stencil to/from combined Z/stencil
surfaces.  But Z-only or stencil-only and separate depth/stencil surfaces
are not yet implemented.
2009-08-05 13:46:47 -06:00
Brian Paul
dcebe220f4 mesa: generate GL_INVALID_OPERATION for missing z/stencil when blitting
If glBlitFramebuffer() is called with GL_DEPTH_BUFFER_BIT or
GL_STENCIL_BUFFER_BIT and the src/dst depth/stencil buffers are absent,
report an error.
2009-08-05 13:44:59 -06:00
Brian Paul
f792137593 st/mesa: fix Y inversion and optimize st_BlitFramebuffer()
Need to check for Y inversion separately for src/dest buffers.

If both the src and dest regions are upside down, make them right-side
up for a better chance at a fast path.

progs/tests/copypixrate -blit is much faster now.
2009-08-05 13:26:19 -06:00
Brian Paul
2cd33afa00 util: added comment/question about blit clipping 2009-08-05 13:22:26 -06:00
Brian Paul
727b2d747e mesa: make _mesa_clip_blit() a shared function 2009-08-05 13:21:59 -06:00
Brian Paul
4f36164024 util: added util_blit_pixels() overlap test
A comment alluded to this.  Now it's checked.
2009-08-05 13:19:03 -06:00
Brian Paul
05d393f59f util: fix util_blit_pixels() test for surface_copy() path
For the surface_copy() path require same format, no flipping and no stretching.

Fixes progs/tests/copypixrate -blit
2009-08-05 13:09:15 -06:00
Brian Paul
854ea483d4 util: reformatting and comments 2009-08-05 13:08:19 -06:00
Brian Paul
3a221a9018 docs: 7.5.1 bug fixes 2009-08-04 09:27:49 -06:00
Brian Paul
61673aebb0 intel: Fix inverted test for disabling flushing of front buffer output.
The comment disagreed with the code, and nicely drew my eyes to what was
going wrong.

Bug #21774 (blender)
Bug #21788 (readpix)

(cherry picked from master, commit fd65418f60)
2009-08-04 09:23:17 -06:00
Brian Paul
f5f8be8bb2 intel: Wait on the last swapbuffers to complete before queuing a new one.
This fixes jerkiness in doom3 and other apps since the kernel change to
throttle less absurdly, which led to a thundering herd of frames.

Because this is a rather minimal fix, there is at least one downside: If
the whole scene completes in one batchbuffer, we'll end up stalling the GPU.

Thanks to Michel Dänzer for suggesting using glFlush to signal frame end
instead of going to all the effort of adding a new DRI2 extension.

(cherry picked from master, commit 0828579a65)
2009-08-04 09:22:15 -06:00
Brian Paul
2bec909c69 texenv: Use VP->Current, since _Current isn't updated at this point.
(cherry picked from master, commit a9ba1bfeb3)
2009-08-04 09:15:33 -06:00
Brian Paul
f0df08abbe texenv: Match state.c in deciding whether we'll be using a vertex shader.
(cherry picked from master, commit 40990d9dfb)
2009-08-04 09:15:09 -06:00
Brian Paul
9d3929b60c texenv: Add missing dependency on VP changes.
Funny thing is I annotated this dependency in
e5f63c403b, but didn't actually use it.

(cherry picked from master, commit 03187571b6)

Conflicts:
	src/mesa/main/state.c
2009-08-04 09:14:33 -06:00
Dan Nicholson
9185a61c8a mklib: Ensure target directory exists for library
Instead of relying on the Makefile to always generate $(TOP)/$(LIB_DIR),
just have mklib handle creating the directory. This should fix any races
when using parallel make.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 23671e5358)
2009-08-04 06:30:46 -07:00
Peter Hutterer
0ce73f84e9 Add missing X11_INCLUDES to egl/drivers/demo and egl/main.
Compiling mesa on a system with no X headers installed in the default
include paths fails due to missing X11 includes. The header includes are
picked up by configure but not applied.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 5358e54d1a)
2009-08-04 06:30:30 -07:00
Pauli Nieminen
fb7cf731f9 xdemo/glxswapcontrol: Move get_framge_usage after the swap.
This fixes the problem that first frame would report bogus usage values.
Problem was caused because get_frame_usage returned data from previous buffer
swap.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-03 13:42:05 -06:00
Pauli Nieminen
b59eb3b8b1 xdemos/glxcontexts: Don't leak visual info when choosing visual again.
Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-03 11:55:29 -06:00
Brian Paul
ed6125fe9b st/mesa: we don't support GL_NV_point_sprite (see comment) 2009-08-03 11:16:23 -06:00
Brian Paul
35e3449ad7 mesa: move misplaced return statement
Fixes regression from commit 7d93f817c9
2009-07-30 09:02:36 -06:00
Brian Paul
7d93f817c9 mesa: add missing return after catching program error 2009-07-30 08:23:26 -06:00
Keith Whitwell
6842829539 mesa/st: short-circuit glFinish calls on WIN32 only
Windows opengl32.dll calls glFinish prior to every swapbuffers, which
makes it pretty hard to get decent performance...

Work around by mapping finish to flush on PIPE_OS_WINDOWS.  This is
conformant, though it might confuse poorly-written benchmarks which
attempt to measure a single event rather than figuring out the rate of
continuous processing.
2009-07-29 12:48:05 +01:00
Keith Whitwell
2420b283b7 mesa/st: recognize no-op scissor state when checking clear_with_quads
Some apps enable scissor but set the rectangle to the dimensions of
the window.  Don't let this force us onto a slower clear path.
2009-07-29 12:48:04 +01:00
Keith Whitwell
4d99e14535 util: _debug_printf should print even when DEBUG is not defined
The leading underscore is meaningful...  This function is used by
_warning and _error functions as well as the more common
debug_printf().

debug_printf (without underscore) gets turned off when DEBUG is
disabled, but warning/error messages still use this function to get
their message out.
(cherry picked from commit 0ac879dca7)
2009-07-29 12:48:04 +01:00
RALOVICH, Kristóf
45f4e8842e glx: assign per screen driver configs (DRISW) 2009-07-28 10:35:56 -06:00
RALOVICH, Kristóf
d090ba9e00 glx: assign per screen driver configs (DRI) 2009-07-28 10:35:56 -06:00
RALOVICH, Kristóf
82f4dc21cc glx: assign per screen driver configs (DRI2) 2009-07-28 10:35:56 -06:00
RALOVICH, Kristóf
e32b601e7d glx: properly release DRI configs
Release per screen DRI driver configs during screen destruction.
2009-07-28 10:35:56 -06:00
RALOVICH, Kristóf
ce0ad53281 glx: cache DRI configs in __GLXscreenConfigsRec 2009-07-28 10:35:56 -06:00
Vinson Lee
bc60b88411 progs/trivial: add missing files to Makefile, .gitignore 2009-07-28 08:54:48 -06:00
Brian Paul
3dbaf68bdc intel: Fix leak of DRI option info due to using the wrong free routine.
(cherry picked from commit 6d66f23c50)
2009-07-27 15:33:07 -06:00
Brian Paul
722d136f7b intel: Clean up leak of driver context structure on context destroy.
(cherry picked from commit ddef7dc87b)
2009-07-27 15:33:07 -06:00
Brian Paul
a7427b0f7b st/mesa: silence warning 2009-07-27 15:10:28 -06:00
Brian Paul
0ad9eba333 mesa: separate some finite/pragma Watcom stuff 2009-07-27 15:10:00 -06:00
Brian Paul
7e2f26cbbf softpipe: include sp_winsys.h to silence function prototype warning 2009-07-27 15:08:44 -06:00
Brian Paul
d2f56fe687 intel: Use _mesa_warning() to report GEM warnings 2009-07-27 14:35:18 -06:00
Karl Schultz
09ef339b69 windows: updated VC8 project files
See bug 22882.
2009-07-27 13:38:35 -06:00
Brian Paul
25e371fb7b docs: 7.5 tarball md5sums 2009-07-27 13:27:54 -06:00
José Fonseca
5276b049b4 util: fix typo. 2009-07-26 20:31:59 +01:00
Brian Paul
c57d81ddc9 mesa: include glew headers in MesaDemos tarballs 2009-07-23 20:20:39 -06:00
Brian Paul
b4ba6a66b7 docs: initial release notes for 7.5.1 2009-07-22 12:49:34 -06:00
Brian Paul
9c4b877519 mesa: bump version to 7.5.1 2009-07-22 12:46:53 -06:00
Brian Paul
b9e2e32daf mesa: include GLEW sources in MesaDemos tarball 2009-07-22 12:34:07 -06:00
Eric Anholt
a6b314150c intel: Fall back on glBitmap with fog enabled.
We would have to build the program with the appropriate fog mode, and
also supply the fog coordinate if appropriate.

Bug #19413.
(cherry picked from commit 8ae02a3919)
2009-07-20 19:10:32 -07:00
Eric Anholt
1b445f9673 i965: Don't clip everything if FRONT_AND_BACK culling while culling disabled.
Fixes everything-black with meta_clear_tris on quake4-mpdemo and doom3-demo.

Bug #18844, 22077.
(cherry picked from commit 81d5550684)
2009-07-20 19:10:20 -07:00
Michel Dänzer
5ed4404005 radeon: With DRI1, if we have HW stencil, only expose fbconfigs with stencil.
Otherwise simple apps like glxgears pick up a DirectColor visual since the X
server mixes the depth 32 visual in with the other GLX visuals, and this seems
to result in a (mostly) black screen due to a bad ColorMap for a lot of people.

The bad ColorMap may be a bug in the apps, the X server or X driver, and
regardless of that I think the X server should ideally make the depth 32 GLX
visual separate from the rest again, but in the meantime this makes us cope.

(depth_bits is either 16 or 24, never 0)
2009-07-20 20:34:04 +02:00
136 changed files with 3058 additions and 1026 deletions

View File

@@ -182,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.5
VERSION=7.5.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -388,7 +388,17 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLEW_FILES = \
$(DIRECTORY)/include/GL/glew.h \
$(DIRECTORY)/include/GL/glxew.h \
$(DIRECTORY)/include/GL/wglew.h \
$(DIRECTORY)/src/glew/*.c \
$(DIRECTORY)/src/glew/Makefile \
$(DIRECTORY)/src/glew/SConscript \
$(DIRECTORY)/src/glew/LICENSE.txt
DEMO_FILES = \
$(GLEW_FILES) \
$(DIRECTORY)/progs/beos/*.cpp \
$(DIRECTORY)/progs/beos/Makefile \
$(DIRECTORY)/progs/images/*.rgb \

View File

@@ -971,5 +971,6 @@ esac
#
if [ ${INSTALLDIR} != "." ] ; then
echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
mv ${FINAL_LIBS} ${INSTALLDIR}/
fi

View File

@@ -33,9 +33,9 @@ else:
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
if default_platform in ('linux', 'freebsd', 'darwin'):
if default_platform in ('linux', 'freebsd'):
default_dri = 'yes'
elif default_platform in ('winddk', 'windows', 'wince'):
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
default_dri = 'no'
else:
default_dri = 'no'

View File

@@ -10,7 +10,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=5
MESA_TINY=0
MESA_TINY=2
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -23,6 +23,7 @@ HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
# Compiler for building demos/tests/etc

View File

@@ -121,6 +121,7 @@ AC_ARG_ENABLE([32-bit],
if test "x$enable_32bit" = xyes; then
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -m32"
ARCH_FLAGS="$ARCH_FLAGS -m32"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -m32"
@@ -1145,6 +1146,21 @@ AC_ARG_WITH([xorg-driver-dir],
[XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
AC_SUBST([XORG_DRIVER_INSTALL_DIR])
AC_ARG_WITH([max-width],
[AS_HELP_STRING([--with-max-width=N],
[Maximum framebuffer width (4096)])],
[DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
AS_IF([test "${withval}" -gt "4096"],
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
)
AC_ARG_WITH([max-height],
[AS_HELP_STRING([--with-max-height=N],
[Maximum framebuffer height (4096)])],
[DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
AS_IF([test "${withval}" -gt "4096"],
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
)
dnl
dnl Gallium Intel configuration
dnl
@@ -1172,7 +1188,7 @@ if test "x$enable_gallium_radeon" = xyes; then
fi
dnl
dnl Gallium Radeon configuration
dnl Gallium Nouveau configuration
dnl
AC_ARG_ENABLE([gallium-nouveau],
[AS_HELP_STRING([--enable-gallium-nouveau],

View File

@@ -39,7 +39,6 @@ a:visited {
<ul>
<li><a href="download.html" target="MainFrame">Downloading / Unpacking</a>
<li><a href="install.html" target="MainFrame">Compiling / Installing</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="precompiled.html" target="MainFrame">Precompiled Libraries</a>
</ul>
@@ -68,6 +67,7 @@ a:visited {
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
<li><a href="shading.html" target="MainFrame">Shading Language</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>

View File

@@ -9,14 +9,14 @@
<H1>Downloading</H1>
<p>
Primary download site:
<a href="http://sourceforge.net/project/showfiles.php?group_id=3"
target="_parent">SourceForge</a>
Primary Mesa download site:
<a href="ftp://ftp.freedesktop.org/pub/mesa/"
target="_parent">freedesktop.org</a> (FTP)
</p>
<p>
When a new release is coming, release candidates (betas) can be found
<a href="http://www.mesa3d.org/beta/">here</a>.
When a new release is coming, release candidates (betas) may be found
<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/" target="_parent">here</a>.
</p>

View File

@@ -316,6 +316,19 @@ Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
will fix the problem.
</p>
<h2>3.6 How can I change the maximum framebuffer size in Mesa's
<tt>swrast</tt> backend?</h2>
<p>
These can be overridden by using the <tt>--with-max-width</tt> and
<tt>--with-max-height</tt> options. The two need not be equal.
</p><p>
Do note that Mesa uses these values to size some internal buffers,
so increasing these sizes will cause Mesa to require additional
memory. Furthermore, increasing these limits beyond <tt>4096</tt>
may introduce rasterization artifacts; see the leading comments in
<tt>src/mesa/swrast/s_tritemp.h</tt>.
</p>
<br>
<br>

View File

@@ -11,6 +11,13 @@
<H1>News</H1>
<h2>September 3, 2009</h2>
<p>
<a href="relnotes-7.5.1.html">Mesa 7.5.1</a> is released.
This is a bug-fix release which fixes bugs found in version 7.5.
</p>
<h2>July 17, 2009</h2>
<p>
<a href="relnotes-7.5.html">Mesa 7.5</a> is released.

View File

@@ -9,17 +9,11 @@
<H1>Precompiled Libraries</H1>
<p>
In general, precompiled libraries are not available.
However, people occasionally prepare packages of precompiled libraries
for some systems.
In general, precompiled Mesa libraries are not available.
</p>
<H2>Mesa-6.0 for Solaris</H2>
<p>
Steve Christensen has submitted precompiled Mesa-6.0 libraries for
Solaris at <a href="http://sunfreeware.com/" target="_parent">
sunfreeware.com</a>.
However, some Linux distros (such as Ubuntu) seem to closely track
Mesa and often have the latest Mesa release available as an update.
</p>
</BODY>

72
docs/relnotes-7.5.1.html Normal file
View File

@@ -0,0 +1,72 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.5.1 Release Notes, 3 September 2009</H1>
<p>
Mesa 7.5.1 is a bug-fix release fixing issues found since the 7.5 release.
</p>
<p>
The main new feature of Mesa 7.5.x is the
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5.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>
d7269e93bc7484430637d54ced250876 MesaLib-7.5.1.tar.gz
877d6a4b24efc2b1d02aa553f262cba8 MesaLib-7.5.1.tar.bz2
23f4fb757a05c8396425681234ae20e5 MesaLib-7.5.1.zip
5af4bd113652108f5cec5113dad813f2 MesaDemos-7.5.1.tar.gz
785402e3b9f0e335538fcc6bf19f6987 MesaDemos-7.5.1.tar.bz2
950058cc6d6106e9c7d5876a03789fe9 MesaDemos-7.5.1.zip
cb52ce2c93389c2711cbe8d857ec5303 MesaGLUT-7.5.1.tar.gz
e3a9892e056d625c5353617a7c5b7e9c MesaGLUT-7.5.1.tar.bz2
da1de364df148c94b4994006191a1e69 MesaGLUT-7.5.1.zip
</pre>
<h2>New features</h2>
<ul>
<li>Added configure --with-max-width=W, --with-max-height=H options to specify
max framebuffer, viewport size.
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Added missing GLEW library to MesaDemos tarballs.
<li>Fixed swapbuffers jerkiness in Doom3/etc in Intel drivers.
<li>Fixed front buffer rendering bug in Intel drivers.
<li>Fixed minor GLX memory leaks.
<li>Fixed some texture env / fragment program state bugs.
<li>Fixed some Gallium glBlitFramebuffer() bugs
<li>Empty glBegin/glEnd() pair could cause divide by zero (bug 23489)
<li>Fixed Gallium glBitmap() Z position bug
<li>Setting arrays of sampler uniforms did not work
<li>Selection/Feedback mode didn't handle polygon culling correctly (bug 16866)
<li>Fixed 32/64-bit cross compilation issue in gen_matypes.c
<li>Fixed glXCreateGLXPixmap() for direct rendering.
<li>Fixed Gallium glCopyPixels(GL_STENCIL_INDEX) mispositioned image bug.
</ul>
</body>
</html>

67
docs/relnotes-7.5.2.html Normal file
View File

@@ -0,0 +1,67 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<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.
</p>
<p>
The main new feature of Mesa 7.5.x is the
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
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>
<h2>New features</h2>
<ul>
<li>Detect B43 chipset in Intel driver
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Assorted bug fixes for i965/i945 drivers
<li>Fixed Gallium glDrawPixels(GL_STENCIL_INDEX) failure.
<li>Fixed GLSL linker/preprocessor version directive issue seen in Wine
(such as bug 23946)
<li>glUseProgram() is now compiled into display lists (bug 23746).
<li>glUniform functions are now compiled into display lists
<li>Auto mipmap generation didn't work reliably with Gallium.
<li>Fixed random number usage in GLX code.
<li>Fixed invalid GL_OUT_OF_MEMORY error sometimes raised by glTexSubImage2D
when using Gallium.
</ul>
</body>
</html>

View File

@@ -40,7 +40,15 @@ If you're especially concerned with stability you should probably look for
<h2>MD5 checksums</h2>
<pre>
tbd
553fd956e544727f30fbe249619b6286 MesaLib-7.5.tar.gz
459f332551f6ebb86f384d21dd15e1f0 MesaLib-7.5.tar.bz2
8c02c0e17a9025250d20424ae32f5163 MesaLib-7.5.zip
a188da2886fa5496ea0c2cda602b2eeb MesaDemos-7.5.tar.gz
398ee8801814a00e47f6c2314e3dfddc MesaDemos-7.5.tar.bz2
15a0c8ae013c54335a26335e1a98d609 MesaDemos-7.5.zip
81010147def5a644ba14f9bbb7a49a2a MesaGLUT-7.5.tar.gz
baa7a1e850b6e39bae58868fd0684004 MesaGLUT-7.5.tar.bz2
265228418e4423fa328f2f5b7970cf08 MesaGLUT-7.5.zip
</pre>

View File

@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<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>
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>

View File

@@ -69,7 +69,8 @@ typedef HWND NativeWindowType;
typedef HBITMAP NativePixmapType;
/** END Added for Windows **/
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun)
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__APPLE__)
/** BEGIN Added for X (Mesa) **/
#ifndef EGLAPI

View File

@@ -498,7 +498,7 @@ SetupFunctionPointers(void)
* Make FBO to render into given texture.
*/
static GLuint
MakeFBO_RenderTexture(GLuint TexObj)
MakeFBO_RenderTexture(GLuint texObj)
{
GLuint fb;
GLint sizeFudge = 0;
@@ -507,7 +507,7 @@ MakeFBO_RenderTexture(GLuint TexObj)
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, fb);
/* Render color to texture */
glFramebufferTexture2D_func(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
TexTarget, TexObj, TextureLevel);
TexTarget, texObj, TextureLevel);
if (Use_ARB_fbo) {
/* use a smaller depth buffer to see what happens */
@@ -541,7 +541,7 @@ MakeFBO_RenderTexture(GLuint TexObj)
/* queries */
{
GLint bits, w, h;
GLint bits, w, h, name;
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, DepthRB);
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
@@ -559,8 +559,28 @@ MakeFBO_RenderTexture(GLuint TexObj)
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_STENCIL_SIZE_EXT, &bits);
printf("Stencil renderbuffer size = %d bits\n", bits);
}
glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
&name);
printf("Render to texture name: %d\n", texObj);
printf("Color attachment[0] name: %d\n", name);
assert(texObj == name);
glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
&name);
printf("Stencil attachment name: %d\n", name);
glGetFramebufferAttachmentParameteriv_func(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT,
&name);
printf("Depth attachment name: %d\n", name);
}
/* bind the regular framebuffer */
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, 0);

View File

@@ -32,6 +32,7 @@ DEMO_SOURCES = \
pointcoord.c \
points.c \
samplers.c \
samplers_array.c \
shadow_sampler.c \
skinning.c \
texaaline.c \
@@ -188,7 +189,8 @@ samplers.o: $(UTIL_HEADERS)
samplers: samplers.o $(UTIL_OBJS)
samplers_array.o: $(UTIL_HEADERS)
samplers_array.o: samplers.c $(UTIL_HEADERS)
$(APP_CC) -I$(INCDIR) $(CFLAGS) -DSAMPLERS_ARRAY $< -c -o $@
samplers_array: samplers_array.o $(UTIL_OBJS)

View File

@@ -211,10 +211,18 @@ InitTextures(void)
for (y = 0; y < stripeSize; y++) {
for (x = 0; x < size; x++) {
GLint k = 4 * ((ypos + y) * size + x);
texImage[k + 0] = intensity;
texImage[k + 1] = intensity;
texImage[k + 2] = 0;
texImage[k + 3] = 255;
if (x < size / 2) {
texImage[k + 0] = intensity;
texImage[k + 1] = intensity;
texImage[k + 2] = 0;
texImage[k + 3] = 255;
}
else {
texImage[k + 0] = 255 - intensity;
texImage[k + 1] = 0;
texImage[k + 2] = 0;
texImage[k + 3] = 255;
}
}
}

View File

@@ -127,7 +127,7 @@ Init( void )
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
printf("GL_EXT_framebuffer_object not found!\n");
/*exit(0);*/
exit(0);
}
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));

View File

@@ -258,8 +258,26 @@ static void Init( void )
}
glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE);
#ifdef TEST_PBO_DLIST
/* test fetching teximage from PBO in display list */
{
GLuint b = 42, l = 10;
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, b);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER, sizeof(BorderImage),
BorderImage, GL_STREAM_DRAW);
glNewList(l, GL_COMPILE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
GL_RGBA, GL_UNSIGNED_BYTE, (void *) 0/* BorderImage*/);
glEndList();
glCallList(l);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
}
#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage);
#endif
for (i = 0; i < SIZE; i++) {
for (j = 0; j < SIZE; j++) {

View File

@@ -5,10 +5,17 @@ clear-random
clear-repeat
clear-scissor
clear-undefined
createwin
dlist-begin-call-end
dlist-dangling
dlist-degenerate
dlist-edgeflag
dlist-edgeflag-dangling
dlist-flat-tri
dlist-mat-tri
dlist-recursive-call
dlist-tri-flat-tri
dlist-tri-mat-tri
draw2arrays
drawarrays
drawelements
@@ -30,6 +37,7 @@ lineloop
lineloop-clip
lineloop-elts
linestrip
linestrip-clip
linestrip-flat-stipple
linestrip-stipple
linestrip-stipple-wide
@@ -70,8 +78,10 @@ quadstrip-cont
quadstrip-flat
readtex.c
readtex.h
readpixels
tri
tri-alpha
tri-alpha-tex
tri-array-interleaved
tri-blend
tri-blend-color
@@ -79,6 +89,7 @@ tri-blend-max
tri-blend-min
tri-blend-revsub
tri-blend-sub
tri-clear
tri-clip
tri-cull
tri-cull-both
@@ -93,6 +104,7 @@ tri-fog
tri-fp
tri-fp-const-imm
tri-lit
tri-lit-material
tri-logicop-none
tri-logicop-xor
tri-mask-tri
@@ -101,6 +113,7 @@ tri-orig
tri-query
tri-repeat
tri-scissor-tri
tri-square
tri-stencil
tri-stipple
tri-tex
@@ -110,6 +123,7 @@ tri-unfilled
tri-unfilled-clip
tri-unfilled-edgeflag
tri-unfilled-fog
tri-unfilled-point
tri-unfilled-smooth
tri-unfilled-tri
tri-unfilled-tri-lit
@@ -118,6 +132,7 @@ tri-unfilled-userclip-stip
tri-userclip
tri-viewport
tri-z
tri-z-9
tri-z-eq
trifan
trifan-flat

View File

@@ -18,6 +18,7 @@ SOURCES = \
clear-repeat.c \
clear-random.c \
clear.c \
createwin.c \
dlist-dangling.c \
dlist-flat-tri.c \
dlist-mat-tri.c \
@@ -48,6 +49,7 @@ SOURCES = \
lineloop-clip.c \
lineloop-elts.c \
lineloop.c \
linestrip-clip.c \
linestrip-flat-stipple.c \
linestrip-stipple-wide.c \
linestrip-stipple.c \
@@ -87,7 +89,9 @@ SOURCES = \
quadstrip-cont.c \
quadstrip-flat.c \
quadstrip.c \
readpixels.c \
tri-alpha.c \
tri-alpha-tex.c \
tri-array-interleaved.c \
tri-blend-color.c \
tri-blend-max.c \
@@ -95,6 +99,7 @@ SOURCES = \
tri-blend-revsub.c \
tri-blend-sub.c \
tri-blend.c \
tri-clear.c \
tri-clip.c \
tri-cull-both.c \
tri-cull.c \
@@ -117,6 +122,7 @@ SOURCES = \
tri-query.c \
tri-repeat.c \
tri-scissor-tri.c \
tri-square.c \
tri-stencil.c \
tri-stipple.c \
tri-multitex-vbo.c \
@@ -126,6 +132,7 @@ SOURCES = \
tri-unfilled-fog.c \
tri-unfilled-edgeflag.c \
tri-unfilled-clip.c \
tri-unfilled-point.c \
tri-unfilled-smooth.c \
tri-unfilled-tri.c \
tri-unfilled-tri-lit.c \
@@ -134,6 +141,7 @@ SOURCES = \
tri-unfilled.c \
tri-userclip.c \
tri-viewport.c \
tri-z-9.c \
tri-z-eq.c \
tri-z.c \
tri.c \

View File

@@ -119,6 +119,12 @@ static void Init( void )
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
sz, (const GLubyte *) buf);
if (glGetError()) {
printf("Program failed to compile:\n%s\n", buf);
printf("Error: %s\n",
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
exit(1);
}
assert(glIsProgramARB(prognum));
}

View File

@@ -378,6 +378,9 @@ make_window( Display *dpy, const char *name,
scrnum = DefaultScreen( dpy );
root = RootWindow( dpy, scrnum );
if (visinfo)
XFree(visinfo);
visinfo = glXChooseVisual( dpy, scrnum, attribs );
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");

View File

@@ -587,6 +587,9 @@ event_loop(Display *dpy, Window win)
angle += 2.0;
draw();
glXSwapBuffers(dpy, win);
if ( get_frame_usage != NULL ) {
GLfloat temp;
@@ -594,8 +597,6 @@ event_loop(Display *dpy, Window win)
frame_usage += temp;
}
glXSwapBuffers(dpy, win);
/* calc framerate */
{
static int t0 = -1;

View File

@@ -4,7 +4,7 @@ TOP = ../../../..
include $(TOP)/configs/current
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/egl/main $(X11_INCLUDES)
SOURCES = demo.c

View File

@@ -4,7 +4,7 @@ TOP = ../../..
include $(TOP)/configs/current
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi
INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi $(X11_INCLUDES)
HEADERS = \
eglconfig.h \

View File

@@ -158,6 +158,60 @@ static void do_triangle( struct draw_context *draw,
#define QUAD(i0,i1,i2,i3) \
do_triangle( draw, \
( DRAW_PIPE_RESET_STIPPLE | \
DRAW_PIPE_EDGE_FLAG_0 | \
DRAW_PIPE_EDGE_FLAG_2 ), \
verts + stride * elts[i0], \
verts + stride * elts[i1], \
verts + stride * elts[i3]); \
do_triangle( draw, \
( DRAW_PIPE_EDGE_FLAG_0 | \
DRAW_PIPE_EDGE_FLAG_1 ), \
verts + stride * elts[i1], \
verts + stride * elts[i2], \
verts + stride * elts[i3])
#define TRIANGLE(flags,i0,i1,i2) \
do_triangle( draw, \
elts[i0], /* flags */ \
verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK), \
verts + stride * elts[i1], \
verts + stride * elts[i2])
#define LINE(flags,i0,i1) \
do_line( draw, \
elts[i0], \
verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK), \
verts + stride * elts[i1])
#define POINT(i0) \
do_point( draw, \
verts + stride * elts[i0] )
#define FUNC pipe_run
#define ARGS \
struct draw_context *draw, \
unsigned prim, \
struct vertex_header *vertices, \
unsigned stride, \
const ushort *elts
#define LOCAL_VARS \
char *verts = (char *)vertices; \
boolean flatfirst = (draw->rasterizer->flatshade && \
draw->rasterizer->flatshade_first); \
unsigned i; \
ushort flags
#define FLUSH
#include "draw_pt_decompose.h"
#undef ARGS
#undef LOCAL_VARS
/* Code to run the pipeline on a fairly arbitary collection of vertices.
*
@@ -178,34 +232,12 @@ void draw_pipeline_run( struct draw_context *draw,
unsigned count )
{
char *verts = (char *)vertices;
unsigned i;
draw->pipeline.verts = verts;
draw->pipeline.vertex_stride = stride;
draw->pipeline.vertex_count = vertex_count;
switch (prim) {
case PIPE_PRIM_POINTS:
for (i = 0; i < count; i++)
do_point( draw,
verts + stride * elts[i] );
break;
case PIPE_PRIM_LINES:
for (i = 0; i+1 < count; i += 2)
do_line( draw,
elts[i+0], /* flags */
verts + stride * (elts[i+0] & ~DRAW_PIPE_FLAG_MASK),
verts + stride * elts[i+1]);
break;
case PIPE_PRIM_TRIANGLES:
for (i = 0; i+2 < count; i += 3)
do_triangle( draw,
elts[i+0], /* flags */
verts + stride * (elts[i+0] & ~DRAW_PIPE_FLAG_MASK),
verts + stride * elts[i+1],
verts + stride * elts[i+2]);
break;
}
pipe_run(draw, prim, vertices, stride, elts, count);
draw->pipeline.verts = NULL;
draw->pipeline.vertex_count = 0;

View File

@@ -477,6 +477,8 @@ tgsi_default_full_instruction( void )
full_instruction.FullSrcRegisters[i] = tgsi_default_full_src_register();
}
full_instruction.Flags = 0x0;
return full_instruction;
}

View File

@@ -62,6 +62,9 @@
#define FAST_MATH 1
/** for tgsi_full_instruction::Flags */
#define SOA_DEPENDENCY_FLAG 0x1
#define TILE_TOP_LEFT 0
#define TILE_TOP_RIGHT 1
#define TILE_BOTTOM_LEFT 2
@@ -182,7 +185,7 @@ print_temp(const struct tgsi_exec_machine *mach, uint index)
* MOV t3, t2;
* The second instruction will have the wrong value for t0 if executed as-is.
*/
static boolean
boolean
tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst)
{
uint i, chan;
@@ -328,20 +331,25 @@ tgsi_exec_machine_bind_shader(
* sizeof(struct tgsi_full_instruction));
maxInstructions += 10;
}
if (tgsi_check_soa_dependencies(&parse.FullToken.FullInstruction)) {
uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode;
parse.FullToken.FullInstruction.Flags = SOA_DEPENDENCY_FLAG;
/* XXX we only handle SOA dependencies properly for MOV/SWZ
* at this time!
*/
if (opcode != TGSI_OPCODE_MOV && opcode != TGSI_OPCODE_SWZ) {
debug_printf("Warning: SOA dependency in instruction"
" is not handled:\n");
tgsi_dump_instruction(&parse.FullToken.FullInstruction,
numInstructions);
}
}
memcpy(instructions + numInstructions,
&parse.FullToken.FullInstruction,
sizeof(instructions[0]));
#if 0
if (tgsi_check_soa_dependencies(&parse.FullToken.FullInstruction)) {
debug_printf("SOA dependency in instruction:\n");
tgsi_dump_instruction(&parse.FullToken.FullInstruction,
numInstructions);
}
#else
(void) tgsi_check_soa_dependencies;
#endif
numInstructions++;
break;
@@ -2018,9 +2026,23 @@ exec_instruction(
case TGSI_OPCODE_MOV:
case TGSI_OPCODE_SWZ:
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
FETCH( &r[0], 0, chan_index );
STORE( &r[0], 0, chan_index );
if (inst->Flags & SOA_DEPENDENCY_FLAG) {
/* Do all fetches into temp regs, then do all stores to avoid
* intermediate/accidental clobbering. This could be done all the
* time for MOV but for other instructions we'll need more temps...
*/
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
FETCH( &r[chan_index], 0, chan_index );
}
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
STORE( &r[chan_index], 0, chan_index );
}
}
else {
FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
FETCH( &r[0], 0, chan_index );
STORE( &r[0], 0, chan_index );
}
}
break;

View File

@@ -272,6 +272,10 @@ void
tgsi_exec_machine_free_data(struct tgsi_exec_machine *mach);
boolean
tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst);
static INLINE void
tgsi_set_kill_mask(struct tgsi_exec_machine *mach, unsigned mask)
{

View File

@@ -91,6 +91,7 @@ struct tgsi_full_instruction
struct tgsi_instruction_ext_texture InstructionExtTexture;
struct tgsi_full_dst_register FullDstRegisters[TGSI_FULL_MAX_DST_REGISTERS];
struct tgsi_full_src_register FullSrcRegisters[TGSI_FULL_MAX_SRC_REGISTERS];
uint Flags; /**< user-defined usage */
};
union tgsi_full_token

View File

@@ -1107,6 +1107,15 @@ static int
emit_instruction(struct gen_context *gen,
struct tgsi_full_instruction *inst)
{
/* we don't handle saturation/clamping yet */
if (inst->Instruction.Saturate != TGSI_SAT_NONE)
return 0;
/* need to use extra temps to fix SOA dependencies : */
if (tgsi_check_soa_dependencies(inst))
return FALSE;
switch (inst->Instruction.Opcode) {
case TGSI_OPCODE_MOV:
case TGSI_OPCODE_SWZ:

View File

@@ -1502,6 +1502,14 @@ emit_instruction(
if (indirect_temp_reference(inst))
return FALSE;
/* we don't handle saturation/clamping yet */
if (inst->Instruction.Saturate != TGSI_SAT_NONE)
return FALSE;
/* need to use extra temps to fix SOA dependencies : */
if (tgsi_check_soa_dependencies(inst))
return FALSE;
switch (inst->Instruction.Opcode) {
case TGSI_OPCODE_ARL:
FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {

View File

@@ -45,6 +45,7 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_simple_shaders.h"
#include "util/u_surface.h"
#include "cso_cache/cso_context.h"
@@ -61,7 +62,7 @@ struct blit_state
struct pipe_viewport_state viewport;
void *vs;
void *fs;
void *fs[TGSI_WRITEMASK_XYZW + 1];
struct pipe_buffer *vbuf; /**< quad vertices */
unsigned vbuf_slot;
@@ -124,7 +125,7 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
}
/* fragment shader */
ctx->fs = util_make_fragment_tex_shader(pipe);
ctx->fs[TGSI_WRITEMASK_XYZW] = util_make_fragment_tex_shader(pipe);
ctx->vbuf = NULL;
/* init vertex data that doesn't change */
@@ -145,9 +146,13 @@ void
util_destroy_blit(struct blit_state *ctx)
{
struct pipe_context *pipe = ctx->pipe;
unsigned i;
pipe->delete_vs_state(pipe, ctx->vs);
pipe->delete_fs_state(pipe, ctx->fs);
for (i = 0; i < Elements(ctx->fs); i++)
if (ctx->fs[i])
pipe->delete_fs_state(pipe, ctx->fs[i]);
pipe_buffer_reference(&ctx->vbuf, NULL);
@@ -155,7 +160,11 @@ util_destroy_blit(struct blit_state *ctx)
}
static unsigned get_next_slot( struct blit_state *ctx )
/**
* Get offset of next free slot in vertex buffer for quad vertices.
*/
static unsigned
get_next_slot( struct blit_state *ctx )
{
const unsigned max_slots = 4096 / sizeof ctx->vertices;
@@ -173,7 +182,6 @@ static unsigned get_next_slot( struct blit_state *ctx )
}
/**
* Setup vertex data for the textured quad we'll draw.
* Note: y=0=top
@@ -260,20 +268,50 @@ setup_vertex_data_tex(struct blit_state *ctx,
return offset;
}
/**
* \return TRUE if two regions overlap, FALSE otherwise
*/
static boolean
regions_overlap(int srcX0, int srcY0,
int srcX1, int srcY1,
int dstX0, int dstY0,
int dstX1, int dstY1)
{
if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
return FALSE; /* src completely left of dst */
if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
return FALSE; /* dst completely left of src */
if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
return FALSE; /* src completely above dst */
if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
return FALSE; /* dst completely above src */
return TRUE; /* some overlap */
}
/**
* Copy pixel block from src surface to dst surface.
* Overlapping regions are acceptable.
* Flipping and stretching are supported.
* XXX what about clipping???
* XXX need some control over blitting Z and/or stencil.
*/
void
util_blit_pixels(struct blit_state *ctx,
struct pipe_surface *src,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1,
float z, uint filter)
util_blit_pixels_writemask(struct blit_state *ctx,
struct pipe_surface *src,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1,
float z, uint filter,
uint writemask)
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
@@ -285,10 +323,41 @@ util_blit_pixels(struct blit_state *ctx,
const int srcLeft = MIN2(srcX0, srcX1);
const int srcTop = MIN2(srcY0, srcY1);
unsigned offset;
boolean overlap;
assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
filter == PIPE_TEX_MIPFILTER_LINEAR);
assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0));
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
/* do the regions overlap? */
overlap = util_same_surface(src, dst) &&
regions_overlap(srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1);
/*
* Check for simple case: no format conversion, no flipping, no stretching,
* no overlapping.
* Filter mode should not matter since there's no stretching.
*/
if (dst->format == src->format &&
srcX0 < srcX1 &&
dstX0 < dstX1 &&
srcY0 < srcY1 &&
dstY0 < dstY1 &&
(dstX1 - dstX0) == (srcX1 - srcX0) &&
(dstY1 - dstY0) == (srcY1 - srcY0) &&
!overlap) {
pipe->surface_copy(pipe,
dst, dstX0, dstY0, /* dest */
src, srcX0, srcY0, /* src */
srcW, srcH); /* size */
return;
}
if (srcLeft != srcX0) {
/* left-right flip */
int tmp = dstX0;
@@ -303,20 +372,6 @@ util_blit_pixels(struct blit_state *ctx,
dstY1 = tmp;
}
assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0));
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_SAMPLER, 0));
if(dst->format == src->format && (dstX1 - dstX0) == srcW && (dstY1 - dstY0) == srcH) {
/* FIXME: this will most surely fail for overlapping rectangles */
pipe->surface_copy(pipe,
dst, dstX0, dstY0, /* dest */
src, srcX0, srcY0, /* src */
srcW, srcH); /* size */
return;
}
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
@@ -376,8 +431,11 @@ util_blit_pixels(struct blit_state *ctx,
/* texture */
cso_set_sampler_textures(ctx->cso, 1, &tex);
if (ctx->fs[writemask] == NULL)
ctx->fs[writemask] = util_make_fragment_tex_shader_writemask(pipe, writemask);
/* shaders */
cso_set_fragment_shader_handle(ctx->cso, ctx->fs);
cso_set_fragment_shader_handle(ctx->cso, ctx->fs[writemask]);
cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
/* drawing dest */
@@ -412,6 +470,27 @@ util_blit_pixels(struct blit_state *ctx,
}
void
util_blit_pixels(struct blit_state *ctx,
struct pipe_surface *src,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1,
float z, uint filter )
{
util_blit_pixels_writemask( ctx, src,
srcX0, srcY0,
srcX1, srcY1,
dst,
dstX0, dstY0,
dstX1, dstY1,
z, filter,
TGSI_WRITEMASK_XYZW );
}
/* Release vertex buffer at end of frame to avoid synchronous
* rendering.
*/
@@ -485,7 +564,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
cso_set_sampler_textures(ctx->cso, 1, &tex);
/* shaders */
cso_set_fragment_shader_handle(ctx->cso, ctx->fs);
cso_set_fragment_shader_handle(ctx->cso, ctx->fs[TGSI_WRITEMASK_XYZW]);
cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
/* drawing dest */

View File

@@ -60,6 +60,17 @@ util_blit_pixels(struct blit_state *ctx,
int dstX1, int dstY1,
float z, uint filter);
void
util_blit_pixels_writemask(struct blit_state *ctx,
struct pipe_surface *src,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
int dstX0, int dstY0,
int dstX1, int dstY1,
float z, uint filter,
uint writemask);
extern void
util_blit_pixels_tex(struct blit_state *ctx,
struct pipe_texture *tex,

View File

@@ -143,11 +143,9 @@ void _debug_vprintf(const char *format, va_list ap)
#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
/* TODO */
#else /* !PIPE_SUBSYSTEM_WINDOWS */
#ifdef DEBUG
fflush(stdout);
vfprintf(stderr, format, ap);
#endif
#endif
}

View File

@@ -921,11 +921,19 @@ static void
format_to_type_comps(enum pipe_format pformat,
enum dtype *datatype, uint *comps)
{
/* XXX I think this could be implemented in terms of the pf_*() functions */
switch (pformat) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_X8R8G8B8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
case PIPE_FORMAT_B8G8R8X8_UNORM:
case PIPE_FORMAT_R8G8B8A8_SRGB:
case PIPE_FORMAT_R8G8B8X8_SRGB:
case PIPE_FORMAT_A8R8G8B8_SRGB:
case PIPE_FORMAT_X8R8G8B8_SRGB:
case PIPE_FORMAT_B8G8R8A8_SRGB:
case PIPE_FORMAT_B8G8R8X8_SRGB:
case PIPE_FORMAT_R8G8B8_SRGB:
*datatype = DTYPE_UBYTE;
*comps = 4;
return;
@@ -942,12 +950,14 @@ format_to_type_comps(enum pipe_format pformat,
*comps = 3;
return;
case PIPE_FORMAT_L8_UNORM:
case PIPE_FORMAT_L8_SRGB:
case PIPE_FORMAT_A8_UNORM:
case PIPE_FORMAT_I8_UNORM:
*datatype = DTYPE_UBYTE;
*comps = 1;
return;
case PIPE_FORMAT_A8L8_UNORM:
case PIPE_FORMAT_A8L8_SRGB:
*datatype = DTYPE_UBYTE;
*comps = 2;
return;
@@ -1509,6 +1519,17 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
uint zslice = 0;
uint offset;
/* The texture object should have room for the levels which we're
* about to generate.
*/
assert(lastLevel <= pt->last_level);
/* If this fails, why are we here? */
assert(lastLevel > baseLevel);
assert(filter == PIPE_TEX_FILTER_LINEAR ||
filter == PIPE_TEX_FILTER_NEAREST);
/* check if we can render in the texture's format */
if (!screen->is_format_supported(screen, pt->format, PIPE_TEXTURE_2D,
PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {

View File

@@ -152,11 +152,14 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe,
/**
* Make simple fragment texture shader:
* TEX OUT[0], IN[0], SAMP[0], 2D;
* IMM {0,0,0,1} // (if writemask != 0xf)
* MOV OUT[0], IMM[0] // (if writemask != 0xf)
* TEX OUT[0].writemask, IN[0], SAMP[0], 2D;
* END;
*/
void *
util_make_fragment_tex_shader(struct pipe_context *pipe)
util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
unsigned writemask )
{
struct pipe_shader_state shader;
struct tgsi_token tokens[100];
@@ -217,12 +220,43 @@ util_make_fragment_tex_shader(struct pipe_context *pipe)
header,
Elements(tokens) - ti);
if (writemask != TGSI_WRITEMASK_XYZW) {
struct tgsi_full_immediate imm;
static const float value[4] = { 0, 0, 0, 1 };
imm = tgsi_default_full_immediate();
imm.Immediate.NrTokens += 4;
imm.Immediate.DataType = TGSI_IMM_FLOAT32;
imm.u.Pointer = value;
ti += tgsi_build_full_immediate(&imm,
&tokens[ti],
header,
Elements(tokens) - ti );
/* MOV instruction */
inst = tgsi_default_full_instruction();
inst.Instruction.Opcode = TGSI_OPCODE_MOV;
inst.Instruction.NumDstRegs = 1;
inst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_OUTPUT;
inst.FullDstRegisters[0].DstRegister.Index = 0;
inst.Instruction.NumSrcRegs = 1;
inst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_IMMEDIATE;
inst.FullSrcRegisters[0].SrcRegister.Index = 0;
ti += tgsi_build_full_instruction(&inst,
&tokens[ti],
header,
Elements(tokens) - ti );
}
/* TEX instruction */
inst = tgsi_default_full_instruction();
inst.Instruction.Opcode = TGSI_OPCODE_TEX;
inst.Instruction.NumDstRegs = 1;
inst.FullDstRegisters[0].DstRegister.File = TGSI_FILE_OUTPUT;
inst.FullDstRegisters[0].DstRegister.Index = 0;
inst.FullDstRegisters[0].DstRegister.WriteMask = writemask;
inst.Instruction.NumSrcRegs = 2;
inst.InstructionExtTexture.Texture = TGSI_TEXTURE_2D;
inst.FullSrcRegisters[0].SrcRegister.File = TGSI_FILE_INPUT;
@@ -253,6 +287,13 @@ util_make_fragment_tex_shader(struct pipe_context *pipe)
return pipe->create_fs_state(pipe, &shader);
}
void *
util_make_fragment_tex_shader(struct pipe_context *pipe )
{
return util_make_fragment_tex_shader_writemask( pipe,
TGSI_WRITEMASK_XYZW );
}

View File

@@ -49,6 +49,10 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe,
const uint *semantic_indexes);
extern void *
util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
unsigned writemask );
extern void *
util_make_fragment_tex_shader(struct pipe_context *pipe);

View File

@@ -37,6 +37,23 @@ struct pipe_texture;
struct pipe_surface;
/**
* Are s1 and s2 the same surface?
* Surfaces are basically views into textures so check if the two surfaces
* name the same part of the same texture.
*/
static INLINE boolean
util_same_surface(const struct pipe_surface *s1, const struct pipe_surface *s2)
{
return (s1->texture == s2->texture &&
s1->face == s2->face &&
s1->level == s2->level &&
s1->zslice == s2->zslice);
}
extern boolean
util_create_rgba_surface(struct pipe_screen *screen,
uint width, uint height,

View File

@@ -153,7 +153,7 @@ a8r8g8b8_put_tile_rgba(unsigned *dst,
}
/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/
/*** PIPE_FORMAT_X8R8G8B8_UNORM ***/
static void
x8r8g8b8_get_tile_rgba(const unsigned *src,
@@ -596,6 +596,184 @@ r16g16b16a16_put_tile_rgba(short *dst,
}
/*** PIPE_FORMAT_R8G8B8A8_SRGB ***/
/**
* Convert an 8-bit sRGB value from non-linear space to a
* linear RGB value in [0, 1].
* Implemented with a 256-entry lookup table.
*/
static INLINE float
srgb_to_linear(ubyte cs8)
{
static float table[256];
static boolean tableReady = FALSE;
if (!tableReady) {
/* compute lookup table now */
uint i;
for (i = 0; i < 256; i++) {
const float cs = ubyte_to_float(i);
if (cs <= 0.04045) {
table[i] = cs / 12.92f;
}
else {
table[i] = (float) powf((cs + 0.055) / 1.055, 2.4);
}
}
tableReady = TRUE;
}
return table[cs8];
}
/**
* Convert linear float in [0,1] to an srgb ubyte value in [0,255].
* XXX this hasn't been tested (render to srgb surface).
* XXX this needs optimization.
*/
static INLINE ubyte
linear_to_srgb(float cl)
{
if (cl >= 1.0F)
return 255;
else if (cl >= 0.0031308F)
return float_to_ubyte(1.055F * powf(cl, 0.41666F) - 0.055F);
else if (cl > 0.0F)
return float_to_ubyte(12.92F * cl);
else
return 0.0;
}
static void
a8r8g8b8_srgb_get_tile_rgba(const unsigned *src,
unsigned w, unsigned h,
float *p,
unsigned dst_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
float *pRow = p;
for (j = 0; j < w; j++, pRow += 4) {
const unsigned pixel = *src++;
pRow[0] = srgb_to_linear((pixel >> 16) & 0xff);
pRow[1] = srgb_to_linear((pixel >> 8) & 0xff);
pRow[2] = srgb_to_linear((pixel >> 0) & 0xff);
pRow[3] = ubyte_to_float((pixel >> 24) & 0xff);
}
p += dst_stride;
}
}
static void
a8r8g8b8_srgb_put_tile_rgba(unsigned *dst,
unsigned w, unsigned h,
const float *p,
unsigned src_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
const float *pRow = p;
for (j = 0; j < w; j++, pRow += 4) {
unsigned r, g, b, a;
r = linear_to_srgb(pRow[0]);
g = linear_to_srgb(pRow[1]);
b = linear_to_srgb(pRow[2]);
a = float_to_ubyte(pRow[3]);
*dst++ = (a << 24) | (r << 16) | (g << 8) | b;
}
p += src_stride;
}
}
/*** PIPE_FORMAT_A8L8_SRGB ***/
static void
a8l8_srgb_get_tile_rgba(const ushort *src,
unsigned w, unsigned h,
float *p,
unsigned dst_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
float *pRow = p;
for (j = 0; j < w; j++, pRow += 4) {
ushort p = *src++;
pRow[0] =
pRow[1] =
pRow[2] = srgb_to_linear(p & 0xff);
pRow[3] = ubyte_to_float(p >> 8);
}
p += dst_stride;
}
}
static void
a8l8_srgb_put_tile_rgba(ushort *dst,
unsigned w, unsigned h,
const float *p,
unsigned src_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
const float *pRow = p;
for (j = 0; j < w; j++, pRow += 4) {
unsigned r, a;
r = linear_to_srgb(pRow[0]);
a = float_to_ubyte(pRow[3]);
*dst++ = (a << 8) | r;
}
p += src_stride;
}
}
/*** PIPE_FORMAT_L8_SRGB ***/
static void
l8_srgb_get_tile_rgba(const ubyte *src,
unsigned w, unsigned h,
float *p,
unsigned dst_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
float *pRow = p;
for (j = 0; j < w; j++, src++, pRow += 4) {
pRow[0] =
pRow[1] =
pRow[2] = srgb_to_linear(*src);
pRow[3] = 1.0;
}
p += dst_stride;
}
}
static void
l8_srgb_put_tile_rgba(ubyte *dst,
unsigned w, unsigned h,
const float *p,
unsigned src_stride)
{
unsigned i, j;
for (i = 0; i < h; i++) {
const float *pRow = p;
for (j = 0; j < w; j++, pRow += 4) {
unsigned r;
r = linear_to_srgb(pRow[0]);
*dst++ = (ubyte) r;
}
p += src_stride;
}
}
/*** PIPE_FORMAT_I8_UNORM ***/
@@ -946,6 +1124,15 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
case PIPE_FORMAT_R16G16B16A16_SNORM:
r16g16b16a16_get_tile_rgba((short *) src, w, h, dst, dst_stride);
break;
case PIPE_FORMAT_A8R8G8B8_SRGB:
a8r8g8b8_srgb_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
break;
case PIPE_FORMAT_A8L8_SRGB:
a8l8_srgb_get_tile_rgba((ushort *) src, w, h, dst, dst_stride);
break;
case PIPE_FORMAT_L8_SRGB:
l8_srgb_get_tile_rgba((ubyte *) src, w, h, dst, dst_stride);
break;
case PIPE_FORMAT_Z16_UNORM:
z16_get_tile_rgba((ushort *) src, w, h, dst, dst_stride);
break;
@@ -1059,6 +1246,15 @@ pipe_put_tile_rgba(struct pipe_transfer *pt,
case PIPE_FORMAT_R16G16B16A16_SNORM:
r16g16b16a16_put_tile_rgba((short *) packed, w, h, p, src_stride);
break;
case PIPE_FORMAT_A8R8G8B8_SRGB:
a8r8g8b8_srgb_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);
break;
case PIPE_FORMAT_A8L8_SRGB:
a8l8_srgb_put_tile_rgba((ushort *) packed, w, h, p, src_stride);
break;
case PIPE_FORMAT_L8_SRGB:
l8_srgb_put_tile_rgba((ubyte *) packed, w, h, p, src_stride);
break;
case PIPE_FORMAT_Z16_UNORM:
/*z16_put_tile_rgba((ushort *) packed, w, h, p, src_stride);*/
break;

View File

@@ -123,21 +123,25 @@ static enum pipe_error
u_upload_alloc_buffer( struct u_upload_mgr *upload,
unsigned min_size )
{
unsigned size;
/* Release old buffer, if present:
*/
u_upload_flush( upload );
/* Allocate a new one:
*/
upload->size = align(MAX2(upload->default_size, min_size), 4096);
size = align(MAX2(upload->default_size, min_size), 4096);
upload->buffer = pipe_buffer_create( upload->screen,
upload->alignment,
upload->usage | PIPE_BUFFER_USAGE_CPU_WRITE,
upload->size );
size );
if (upload->buffer == NULL)
goto fail;
upload->size = size;
upload->offset = 0;
return 0;

View File

@@ -85,5 +85,7 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba,
/* non-cached surface */
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv);
#endif
}
}
softpipe->dirty_render_cache = TRUE;
}

View File

@@ -84,7 +84,7 @@ softpipe_get_param(struct pipe_screen *screen, int param)
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return 12; /* max 2Kx2K */
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
return 8; /* max 128x128x128 */
return 9; /* max 256x256x256 */
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return 12; /* max 2Kx2K */
case PIPE_CAP_TGSI_CONT_SUPPORTED:

View File

@@ -464,7 +464,7 @@ choose_cube_face(float rx, float ry, float rz, float *newS, float *newT)
unsigned face;
float sc, tc, ma;
if (arx > ary && arx > arz) {
if (arx >= ary && arx >= arz) {
if (rx >= 0.0F) {
face = PIPE_TEX_FACE_POS_X;
sc = -rz;
@@ -478,7 +478,7 @@ choose_cube_face(float rx, float ry, float rz, float *newS, float *newT)
ma = arx;
}
}
else if (ary > arx && ary > arz) {
else if (ary >= arx && ary >= arz) {
if (ry >= 0.0F) {
face = PIPE_TEX_FACE_POS_Y;
sc = rx;

View File

@@ -42,6 +42,7 @@
#include "sp_texture.h"
#include "sp_tile_cache.h"
#include "sp_screen.h"
#include "sp_winsys.h"
/* Simple, maximally packed layout.

View File

@@ -351,7 +351,7 @@ void trace_dump_call_begin_locked(const char *klass, const char *method)
trace_dump_indent(1);
trace_dump_writes("<call no=\'");
trace_dump_writef("%lu", call_no);
trace_dump_writes("\' class =\'");
trace_dump_writes("\' class=\'");
trace_dump_escape(klass);
trace_dump_writes("\' method=\'");
trace_dump_escape(method);

View File

@@ -63,6 +63,13 @@ pipe_buffer_map(struct pipe_screen *screen,
if(screen->buffer_map_range) {
unsigned offset = 0;
unsigned length = buf->size;
/* XXX: Actually we should be using/detecting DISCARD
* instead of assuming that WRITE implies discard */
if((usage & PIPE_BUFFER_USAGE_CPU_WRITE) &&
!(usage & PIPE_BUFFER_USAGE_DISCARD))
usage |= PIPE_BUFFER_USAGE_CPU_READ;
return screen->buffer_map_range(screen, buf, offset, length, usage);
}
else

View File

@@ -743,7 +743,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
struct pipe_screen *screen;
struct pipe_context *pipe;
struct pipe_context *pipe = NULL;
XMesaContext c;
GLcontext *mesaCtx;
uint pf;

View File

@@ -371,7 +371,7 @@ class Main:
stream = GzipFile(arg, 'rt')
elif arg.endswith('.bz2'):
from bz2 import BZ2File
stream = BZ2File(arg, 'rt')
stream = BZ2File(arg, 'rU')
else:
stream = open(arg, 'rt')
self.process_arg(stream, options)

View File

@@ -364,7 +364,7 @@ void xlib_brw_buffer_subdata_typed( struct pipe_winsys *pws,
unsigned data_type )
{
unsigned aub_type = DW_GENERAL_STATE;
unsigned aub_sub_type;
unsigned aub_sub_type = 0;
switch (data_type) {
case BRW_CC_VP:

View File

@@ -303,6 +303,7 @@ xm_flush_frontbuffer(struct pipe_winsys *pws,
*/
XMesaContext xmctx = (XMesaContext) context_private;
xlib_softpipe_display_surface(xmctx->xm_buffer, surf);
xmesa_check_and_update_buffer_size(xmctx, xmctx->xm_buffer);
}

View File

@@ -481,6 +481,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
psc->driver_configs = driver_configs;
psp->destroyScreen = dri2DestroyScreen;
psp->createContext = dri2CreateContext;
psp->createDrawable = dri2CreateDrawable;

View File

@@ -418,6 +418,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
psc->driver_configs = driver_configs;
/* Visuals with depth != screen depth are subject to automatic compositing
* in the X server, so DRI1 can't render to them properly. Mark them as
* non-conformant to prevent apps from picking them up accidentally.

View File

@@ -401,7 +401,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
free(driver_configs);
psc->driver_configs = driver_configs;
psp->destroyScreen = driDestroyScreen;
psp->createContext = driCreateContext;

View File

@@ -39,6 +39,30 @@
#include "glxextensions.h"
#include "glcontextmodes.h"
#define WARN_ONCE_GLX_1_3(a, b) { \
static int warned=1; \
if(warned) { \
warn_GLX_1_3((a), b ); \
warned=0; \
} \
}
/**
* Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
*/
static void
warn_GLX_1_3(Display *dpy, const char *function_name)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
if (priv->minorVersion < 3) {
fprintf(stderr,
"WARNING: Application calling GLX 1.3 function \"%s\" "
"when GLX 1.3 is not supported! This is an application bug!\n",
function_name);
}
}
/**
* Change a drawable's attribute.
@@ -559,6 +583,8 @@ glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
width = 0;
height = 0;
WARN_ONCE_GLX_1_3(dpy, __func__);
for (i = 0; attrib_list[i * 2]; i++) {
switch (attrib_list[i * 2]) {
case GLX_PBUFFER_WIDTH:
@@ -592,6 +618,7 @@ PUBLIC void
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
GetDrawableAttribute(dpy, drawable, attribute, value);
}
@@ -645,6 +672,8 @@ PUBLIC GLXPixmap
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list, X_GLXCreatePixmap);
}
@@ -654,6 +683,8 @@ PUBLIC GLXWindow
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
const int *attrib_list)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list, X_GLXCreateWindow);
}
@@ -662,6 +693,8 @@ glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
PUBLIC void
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap);
}
@@ -669,6 +702,8 @@ glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
PUBLIC void
glXDestroyWindow(Display * dpy, GLXWindow win)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow);
}
@@ -689,3 +724,4 @@ GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long *mask), (dpy, drawable, mask),
glXGetSelectedEvent)

View File

@@ -501,6 +501,8 @@ struct __GLXscreenConfigsRec {
__GLXDRIscreen *driScreen;
const __DRIconfig** driver_configs;
#ifdef __DRI_COPY_SUB_BUFFER
const __DRIcopySubBufferExtension *driCopySubBuffer;
#endif

View File

@@ -845,6 +845,34 @@ PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
req->glxpixmap = xid = XAllocID(dpy);
UnlockDisplay(dpy);
SyncHandle();
#ifdef GLX_DIRECT_RENDERING
do {
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
* is actually bound to a context... */
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
__GLXDRIdrawable *pdraw;
__GLXscreenConfigs *psc;
__GLcontextModes *modes;
psc = &priv->screenConfigs[vis->screen];
if (psc->driScreen == NULL)
break;
modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid);
pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes);
if (pdraw == NULL) {
fprintf(stderr, "failed to create pixmap\n");
break;
}
if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
return None; /* FIXME: Check what we're supposed to do here... */
}
} while (0);
#endif
return xid;
}

View File

@@ -149,6 +149,12 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
Xfree((char *) psc->serverGLXexts);
#ifdef GLX_DIRECT_RENDERING
if (psc->driver_configs) {
for(unsigned int i = 0; psc->driver_configs[i]; i++)
free((__DRIconfig*)psc->driver_configs[i]);
free(psc->driver_configs);
psc->driver_configs = NULL;
}
if (psc->driScreen) {
psc->driScreen->destroyScreen(psc);
__glxHashDestroy(psc->drawHash);

View File

@@ -77,6 +77,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HASH_MAGIC 0xdeadbeef
#define HASH_DEBUG 0
@@ -87,10 +88,21 @@
#define HASH_ALLOC malloc
#define HASH_FREE free
#define HASH_RANDOM_DECL
#define HASH_RANDOM_INIT(seed) srandom(seed)
#define HASH_RANDOM random()
#ifndef __GLIBC__
#define HASH_RANDOM_DECL char *ps, rs[256]
#define HASH_RANDOM_INIT(seed) ps = initstate(seed, rs, sizeof(rs))
#define HASH_RANDOM random()
#define HASH_RANDOM_DESTROY setstate(ps)
#else
#define HASH_RANDOM_DECL struct random_data rd; int32_t rv; char rs[256]
#define HASH_RANDOM_INIT(seed) \
do { \
(void) memset(&rd, 0, sizeof(rd)); \
(void) initstate_r(seed, rs, sizeof(rs), &rd); \
} while(0)
#define HASH_RANDOM ((void) random_r(&rd, &rv), rv)
#define HASH_RANDOM_DESTROY
#endif
typedef struct __glxHashBucket
{

View File

@@ -763,7 +763,7 @@ dri2CreateNewScreen(int scrn, int fd,
if (driDriverAPI.InitScreen2 == NULL)
return NULL;
psp = _mesa_malloc(sizeof(*psp));
psp = _mesa_calloc(sizeof(*psp));
if (!psp)
return NULL;

View File

@@ -1,306 +0,0 @@
/**************************************************************************
*
* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include "main/glheader.h"
#include "main/enums.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/image.h"
#include "main/bufferobj.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_blit.h"
#include "intel_buffers.h"
#include "intel_regions.h"
#include "intel_pixel.h"
#include "intel_buffer_objects.h"
/* For many applications, the new ability to pull the source buffers
* back out of the GTT and then do the packing/conversion operations
* in software will be as much of an improvement as trying to get the
* blitter and/or texture engine to do the work.
*
* This step is gated on private backbuffers.
*
* Obviously the frontbuffer can't be pulled back, so that is either
* an argument for blit/texture readpixels, or for blitting to a
* temporary and then pulling that back.
*
* When the destination is a pbo, however, it's not clear if it is
* ever going to be pulled to main memory (though the access param
* will be a good hint). So it sounds like we do want to be able to
* choose between blit/texture implementation on the gpu and pullback
* and cpu-based copying.
*
* Unless you can magically turn client memory into a PBO for the
* duration of this call, there will be a cpu-based copying step in
* any case.
*/
static GLboolean
do_texture_readpixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack,
struct intel_region *dest_region)
{
#if 0
struct intel_context *intel = intel_context(ctx);
intelScreenPrivate *screen = intel->intelScreen;
GLint pitch = pack->RowLength ? pack->RowLength : width;
__DRIdrawablePrivate *dPriv = intel->driDrawable;
int textureFormat;
GLenum glTextureFormat;
int destFormat, depthFormat, destPitch;
drm_clip_rect_t tmp;
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
if (ctx->_ImageTransferState ||
pack->SwapBytes || pack->LsbFirst || !pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
return GL_FALSE;
}
intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel));
if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: couldn't set dest %s/%s\n",
__FUNCTION__,
_mesa_lookup_enum_by_nr(type),
_mesa_lookup_enum_by_nr(format));
return GL_FALSE;
}
LOCK_HARDWARE(intel);
if (intel->driDrawable->numClipRects) {
intel->vtbl.install_meta_state(intel);
intel->vtbl.meta_no_depth_write(intel);
intel->vtbl.meta_no_stencil_write(intel);
if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
UNLOCK_HARDWARE(intel);
SET_STATE(i830, state);
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
return GL_TRUE;
}
y = dPriv->h - y - height;
x += dPriv->x;
y += dPriv->y;
/* Set the frontbuffer up as a large rectangular texture.
*/
intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat);
intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat);
/* Set the 3d engine to draw into the destination region:
*/
intel->vtbl.meta_draw_region(intel, dest_region);
intel->vtbl.meta_draw_format(intel, destFormat, depthFormat); /* ?? */
/* Draw a single quad, no cliprects:
*/
intel->vtbl.meta_disable_cliprects(intel);
intel->vtbl.draw_quad(intel,
0, width, 0, height,
0x00ff00ff, x, x + width, y, y + height);
intel->vtbl.leave_meta_state(intel);
}
UNLOCK_HARDWARE(intel);
intel_region_wait_fence(ctx, dest_region); /* required by GL */
return GL_TRUE;
#endif
return GL_FALSE;
}
static GLboolean
do_blit_readpixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
struct intel_context *intel = intel_context(ctx);
struct intel_region *src = intel_readbuf_region(intel);
struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
GLuint dst_offset;
GLuint rowLength;
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s\n", __FUNCTION__);
if (!src)
return GL_FALSE;
if (dst) {
/* XXX This validation should be done by core mesa:
*/
if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
return GL_TRUE;
}
}
else {
/* PBO only for now:
*/
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - not PBO\n", __FUNCTION__);
return GL_FALSE;
}
if (ctx->_ImageTransferState ||
!intel_check_blit_format(src, format, type)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - bad format for blit\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: bad packing params\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->RowLength > 0)
rowLength = pack->RowLength;
else
rowLength = width;
if (pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
return GL_FALSE;
}
else {
rowLength = -rowLength;
}
/* XXX 64-bit cast? */
dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
format, type, 0, 0, 0);
/* Although the blits go on the command buffer, need to do this and
* fire with lock held to guarentee cliprects are correct.
*/
intelFlush(&intel->ctx);
LOCK_HARDWARE(intel);
if (intel->driDrawable->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;
int nbox = dPriv->numClipRects;
drm_clip_rect_t *box = dPriv->pClipRects;
drm_clip_rect_t rect;
drm_clip_rect_t src_rect;
int i;
src_rect.x1 = dPriv->x + x;
src_rect.y1 = dPriv->y + dPriv->h - (y + height);
src_rect.x2 = src_rect.x1 + width;
src_rect.y2 = src_rect.y1 + height;
for (i = 0; i < nbox; i++) {
if (!intel_intersect_cliprects(&rect, &src_rect, &box[i]))
continue;
intelEmitCopyBlit(intel,
src->cpp,
src->pitch, src->buffer, 0, src->tiling,
rowLength, dst_buffer, dst_offset, GL_FALSE,
rect.x1,
rect.y1,
rect.x1 - src_rect.x1,
rect.y2 - src_rect.y2,
rect.x2 - rect.x1, rect.y2 - rect.y1,
GL_COPY);
}
}
UNLOCK_HARDWARE(intel);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
return GL_TRUE;
}
void
intelReadPixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
intelFlush(ctx);
if (do_blit_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
if (do_texture_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
_swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
}

View File

@@ -0,0 +1 @@
../intel/intel_pixel_read.c

View File

@@ -22,6 +22,7 @@ DRIVER_SOURCES = \
intel_pixel_bitmap.c \
intel_pixel_copy.c \
intel_pixel_draw.c \
intel_pixel_read.c \
intel_state.c \
intel_swapbuffers.c \
intel_tex.c \

View File

@@ -152,7 +152,8 @@ static void upload_clip_prog(struct brw_context *brw)
/* _NEW_POLYGON */
if (key.primitive == GL_TRIANGLES) {
if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
key.clip_mode = BRW_CLIPMODE_REJECT_ALL;
else {
GLuint fill_front = CLIP_CULL;

View File

@@ -386,6 +386,8 @@ struct brw_cached_batch_item {
struct brw_vertex_element {
const struct gl_client_array *glarray;
/** The corresponding Mesa vertex attribute */
gl_vert_attrib attrib;
/** Size of a complete element */
GLuint element_size;
/** Number of uploaded elements for this input. */
@@ -477,6 +479,9 @@ struct brw_context
struct {
struct brw_vertex_element inputs[VERT_ATTRIB_MAX];
struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
GLuint nr_enabled;
#define BRW_NR_UPLOAD_BUFS 17
#define BRW_UPLOAD_INIT_SIZE (128*1024)

View File

@@ -185,6 +185,7 @@ static void brw_merge_inputs( struct brw_context *brw,
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
brw->vb.inputs[i].glarray = arrays[i];
brw->vb.inputs[i].attrib = (gl_vert_attrib) i;
if (arrays[i]->StrideB != 0)
brw->vb.info.varying |= 1 << i;

View File

@@ -343,16 +343,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
{
GLcontext *ctx = &brw->intel.ctx;
struct intel_context *intel = intel_context(ctx);
GLuint tmp = brw->vs.prog_data->inputs_read;
GLbitfield vs_inputs = brw->vs.prog_data->inputs_read;
GLuint i;
const unsigned char *ptr = NULL;
GLuint interleave = 0;
unsigned int min_index = brw->vb.min_index;
unsigned int max_index = brw->vb.max_index;
struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
GLuint nr_enabled = 0;
struct brw_vertex_element *upload[VERT_ATTRIB_MAX];
GLuint nr_uploads = 0;
@@ -362,12 +359,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
_mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
/* Accumulate the list of enabled arrays. */
while (tmp) {
GLuint i = _mesa_ffsll(tmp)-1;
brw->vb.nr_enabled = 0;
while (vs_inputs) {
GLuint i = _mesa_ffsll(vs_inputs) - 1;
struct brw_vertex_element *input = &brw->vb.inputs[i];
tmp &= ~(1<<i);
enabled[nr_enabled++] = input;
vs_inputs &= ~(1 << i);
brw->vb.enabled[brw->vb.nr_enabled++] = input;
}
/* XXX: In the rare cases where this happens we fallback all
@@ -376,13 +374,13 @@ static void brw_prepare_vertices(struct brw_context *brw)
* cases with > 17 vertex attributes enabled, so it probably
* isn't an issue at this point.
*/
if (nr_enabled >= BRW_VEP_MAX) {
if (brw->vb.nr_enabled >= BRW_VEP_MAX) {
intel->Fallback = 1;
return;
}
for (i = 0; i < nr_enabled; i++) {
struct brw_vertex_element *input = enabled[i];
for (i = 0; i < brw->vb.nr_enabled; i++) {
struct brw_vertex_element *input = brw->vb.enabled[i];
input->element_size = get_size(input->glarray->Type) * input->glarray->Size;
input->count = input->glarray->StrideB ? max_index + 1 - min_index : 1;
@@ -398,6 +396,20 @@ static void brw_prepare_vertices(struct brw_context *brw)
dri_bo_reference(input->bo);
input->offset = (unsigned long)input->glarray->Ptr;
input->stride = input->glarray->StrideB;
/* This is a common place to reach if the user mistakenly supplies
* a pointer in place of a VBO offset. If we just let it go through,
* we may end up dereferencing a pointer beyond the bounds of the
* GTT. We would hope that the VBO's max_index would save us, but
* Mesa appears to hand us min/max values not clipped to the
* array object's _MaxElement, and _MaxElement frequently appears
* to be wrong anyway.
*
* The VBO spec allows application termination in this case, and it's
* probably a service to the poor programmer to do so rather than
* trying to just not render.
*/
assert(input->offset < input->bo->size);
} else {
if (input->bo != NULL) {
/* Already-uploaded vertex data is present from a previous
@@ -410,7 +422,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
/* Queue the buffer object up to be uploaded in the next pass,
* when we've decided if we're doing interleaved or not.
*/
if (i == 0) {
if (input->attrib == VERT_ATTRIB_POS) {
/* Position array not properly enabled:
*/
if (input->glarray->StrideB == 0) {
@@ -466,8 +478,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
brw_prepare_query_begin(brw);
for (i = 0; i < nr_enabled; i++) {
struct brw_vertex_element *input = enabled[i];
for (i = 0; i < brw->vb.nr_enabled; i++) {
struct brw_vertex_element *input = brw->vb.enabled[i];
brw_add_validated_bo(brw, input->bo);
}
@@ -477,34 +489,44 @@ static void brw_emit_vertices(struct brw_context *brw)
{
GLcontext *ctx = &brw->intel.ctx;
struct intel_context *intel = intel_context(ctx);
GLuint tmp = brw->vs.prog_data->inputs_read;
struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
GLuint i;
GLuint nr_enabled = 0;
/* Accumulate the list of enabled arrays. */
while (tmp) {
i = _mesa_ffsll(tmp)-1;
struct brw_vertex_element *input = &brw->vb.inputs[i];
tmp &= ~(1<<i);
enabled[nr_enabled++] = input;
}
brw_emit_query_begin(brw);
/* If the VS doesn't read any inputs (calculating vertex position from
* a state variable for some reason, for example), emit a single pad
* VERTEX_ELEMENT struct and bail.
*
* The stale VB state stays in place, but they don't do anything unless
* a VE loads from them.
*/
if (brw->vb.nr_enabled == 0) {
BEGIN_BATCH(3, IGNORE_CLIPRECTS);
OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1);
OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) |
BRW_VE0_VALID |
(BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
(0 << BRW_VE0_SRC_OFFSET_SHIFT));
OUT_BATCH((BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_0_SHIFT) |
(BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_1_SHIFT) |
(BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_2_SHIFT) |
(BRW_VE1_COMPONENT_STORE_1_FLT << BRW_VE1_COMPONENT_3_SHIFT));
ADVANCE_BATCH();
return;
}
/* Now emit VB and VEP state packets.
*
* This still defines a hardware VB for each input, even if they
* are interleaved or from the same VBO. TBD if this makes a
* performance difference.
*/
BEGIN_BATCH(1 + nr_enabled * 4, IGNORE_CLIPRECTS);
BEGIN_BATCH(1 + brw->vb.nr_enabled * 4, IGNORE_CLIPRECTS);
OUT_BATCH((CMD_VERTEX_BUFFER << 16) |
((1 + nr_enabled * 4) - 2));
((1 + brw->vb.nr_enabled * 4) - 2));
for (i = 0; i < nr_enabled; i++) {
struct brw_vertex_element *input = enabled[i];
for (i = 0; i < brw->vb.nr_enabled; i++) {
struct brw_vertex_element *input = brw->vb.enabled[i];
OUT_BATCH((i << BRW_VB0_INDEX_SHIFT) |
BRW_VB0_ACCESS_VERTEXDATA |
@@ -517,10 +539,10 @@ static void brw_emit_vertices(struct brw_context *brw)
}
ADVANCE_BATCH();
BEGIN_BATCH(1 + nr_enabled * 2, IGNORE_CLIPRECTS);
OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + nr_enabled * 2) - 2));
for (i = 0; i < nr_enabled; i++) {
struct brw_vertex_element *input = enabled[i];
BEGIN_BATCH(1 + brw->vb.nr_enabled * 2, IGNORE_CLIPRECTS);
OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + brw->vb.nr_enabled * 2) - 2));
for (i = 0; i < brw->vb.nr_enabled; i++) {
struct brw_vertex_element *input = brw->vb.enabled[i];
uint32_t format = get_surface_type(input->glarray->Type,
input->glarray->Size,
input->glarray->Format,
@@ -635,7 +657,7 @@ static void brw_emit_indices(struct brw_context *brw)
if (index_buffer == NULL)
return;
ib_size = get_size(index_buffer->type) * index_buffer->count;
ib_size = get_size(index_buffer->type) * index_buffer->count - 1;
/* Emit the indexbuffer packet:
*/

View File

@@ -62,7 +62,7 @@ void brw_set_predicate_control( struct brw_compile *p, GLuint pc )
void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional )
{
p->current->header.destreg__conditonalmod = conditional;
p->current->header.destreg__conditionalmod = conditional;
}
void brw_set_access_mode( struct brw_compile *p, GLuint access_mode )

View File

@@ -377,8 +377,8 @@ static struct brw_instruction *next_insn( struct brw_compile *p,
/* Reset this one-shot flag:
*/
if (p->current->header.destreg__conditonalmod) {
p->current->header.destreg__conditonalmod = 0;
if (p->current->header.destreg__conditionalmod) {
p->current->header.destreg__conditionalmod = 0;
p->current->header.predicate_control = BRW_PREDICATE_NORMAL;
}
@@ -746,7 +746,7 @@ void brw_CMP(struct brw_compile *p,
{
struct brw_instruction *insn = next_insn(p, BRW_OPCODE_CMP);
insn->header.destreg__conditonalmod = conditional;
insn->header.destreg__conditionalmod = conditional;
brw_set_dest(insn, dest);
brw_set_src0(insn, src0);
brw_set_src1(insn, src1);
@@ -790,7 +790,7 @@ void brw_math( struct brw_compile *p,
* instructions.
*/
insn->header.predicate_control = 0;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest);
brw_set_src0(insn, src);
@@ -826,7 +826,7 @@ void brw_math_16( struct brw_compile *p,
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
insn = next_insn(p, BRW_OPCODE_SEND);
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest);
brw_set_src0(insn, src);
@@ -842,7 +842,7 @@ void brw_math_16( struct brw_compile *p,
*/
insn = next_insn(p, BRW_OPCODE_SEND);
insn->header.compression_control = BRW_COMPRESSION_2NDHALF;
insn->header.destreg__conditonalmod = msg_reg_nr+1;
insn->header.destreg__conditionalmod = msg_reg_nr+1;
brw_set_dest(insn, offset(dest,1));
brw_set_src0(insn, src);
@@ -888,7 +888,7 @@ void brw_dp_WRITE_16( struct brw_compile *p,
insn->header.predicate_control = 0; /* XXX */
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest);
brw_set_src0(insn, src);
@@ -933,7 +933,7 @@ void brw_dp_READ_16( struct brw_compile *p,
insn->header.predicate_control = 0; /* XXX */
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest); /* UW? */
brw_set_src0(insn, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW));
@@ -986,7 +986,7 @@ void brw_dp_READ_4( struct brw_compile *p,
insn->header.predicate_control = BRW_PREDICATE_NONE;
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
insn->header.mask_control = BRW_MASK_DISABLE;
/* cast dest to a uword[8] vector */
@@ -1059,7 +1059,7 @@ void brw_dp_READ_4_vs(struct brw_compile *p,
insn->header.predicate_control = BRW_PREDICATE_NONE;
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
insn->header.mask_control = BRW_MASK_DISABLE;
/*insn->header.access_mode = BRW_ALIGN_16;*/
@@ -1092,7 +1092,7 @@ void brw_fb_WRITE(struct brw_compile *p,
insn->header.predicate_control = 0; /* XXX */
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest);
brw_set_src0(insn, src0);
@@ -1187,7 +1187,7 @@ void brw_SAMPLE(struct brw_compile *p,
insn->header.predicate_control = 0; /* XXX */
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(insn, dest);
brw_set_src0(insn, src0);
@@ -1238,7 +1238,7 @@ void brw_urb_WRITE(struct brw_compile *p,
brw_set_src0(insn, src0);
brw_set_src1(insn, brw_imm_d(0));
insn->header.destreg__conditonalmod = msg_reg_nr;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_urb_message(insn,
allocate,

View File

@@ -233,7 +233,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
else if (sf.sf6.line_width <= 0x2)
sf.sf6.line_width = 0;
/* _NEW_POINT */
/* _NEW_BUFFERS */
key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
if (!key->render_to_fbo) {
/* Rendering to an OpenGL window */
@@ -263,6 +263,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
}
/* XXX clamp max depends on AA vs. non-AA */
/* _NEW_POINT */
sf.sf7.sprite_point = key->point_sprite;
sf.sf7.point_size = CLAMP(rint(key->point_size), 1, 255) * (1<<3);
sf.sf7.use_point_size_state = !key->point_attenuated;
@@ -328,7 +329,8 @@ const struct brw_tracked_state brw_sf_unit = {
.mesa = (_NEW_POLYGON |
_NEW_LINE |
_NEW_POINT |
_NEW_SCISSOR),
_NEW_SCISSOR |
_NEW_BUFFERS),
.brw = BRW_NEW_URB_FENCE,
.cache = (CACHE_NEW_SF_VP |
CACHE_NEW_SF_PROG)

View File

@@ -1168,7 +1168,7 @@ struct brw_instruction
GLuint predicate_control:4;
GLuint predicate_inverse:1;
GLuint execution_size:3;
GLuint destreg__conditonalmod:4; /* destreg - send, conditionalmod - others */
GLuint destreg__conditionalmod:4; /* destreg - send, conditionalmod - others */
GLuint pad0:2;
GLuint debug_control:1;
GLuint saturate:1;

View File

@@ -119,6 +119,16 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
}
}
/* The 965's sampler lays cachelines out according to how accesses
* in the texture surfaces run, so they may be "vertical" through
* memory. As a result, the docs say in Surface Padding Requirements:
* Sampling Engine Surfaces that two extra rows of padding are required.
* We don't know of similar requirements for pre-965, but given that
* those docs are silent on padding requirements in general, let's play
* it safe.
*/
if (mt->target == GL_TEXTURE_CUBE_MAP)
mt->total_height += 2;
break;
}

View File

@@ -68,6 +68,7 @@ static void release_tmps( struct brw_vs_compile *c )
static void brw_vs_alloc_regs( struct brw_vs_compile *c )
{
GLuint i, reg = 0, mrf;
int attributes_in_vue;
#if 0
if (c->vp->program.Base.Parameters->NumParameters >= 6)
@@ -123,6 +124,11 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
reg++;
}
}
/* If there are no inputs, we'll still be reading one attribute's worth
* because it's required -- see urb_read_length setting.
*/
if (c->nr_inputs == 0)
reg++;
/* Allocate outputs: TODO: could organize the non-position outputs
* to go straight into message regs.
@@ -200,8 +206,20 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
* vertex urb, so is half the amount:
*/
c->prog_data.urb_read_length = (c->nr_inputs + 1) / 2;
/* Setting this field to 0 leads to undefined behavior according to the
* the VS_STATE docs. Our VUEs will always have at least one attribute
* sitting in them, even if it's padding.
*/
if (c->prog_data.urb_read_length == 0)
c->prog_data.urb_read_length = 1;
/* The VS VUEs are shared by VF (outputting our inputs) and VS, so size
* them to fit the biggest thing they need to.
*/
attributes_in_vue = MAX2(c->nr_outputs, c->nr_inputs);
c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4;
c->prog_data.urb_entry_size = (c->nr_outputs + 2 + 3) / 4;
c->prog_data.total_grf = reg;
if (INTEL_DEBUG & DEBUG_VS) {
@@ -1172,20 +1190,36 @@ post_vs_emit( struct brw_vs_compile *c,
brw_set_src1(end_inst, brw_imm_d(offset * 16));
}
static uint32_t
get_predicate(uint32_t swizzle)
{
switch (swizzle) {
case SWIZZLE_XXXX:
return BRW_PREDICATE_ALIGN16_REPLICATE_X;
case SWIZZLE_YYYY:
return BRW_PREDICATE_ALIGN16_REPLICATE_Y;
case SWIZZLE_ZZZZ:
return BRW_PREDICATE_ALIGN16_REPLICATE_Z;
case SWIZZLE_WWWW:
return BRW_PREDICATE_ALIGN16_REPLICATE_W;
default:
_mesa_problem(NULL, "Unexpected predicate: 0x%08x\n", swizzle);
return BRW_PREDICATE_NORMAL;
}
}
/* Emit the vertex program instructions here.
*/
void brw_vs_emit(struct brw_vs_compile *c )
{
#define MAX_IFSN 32
#define MAX_IF_DEPTH 32
struct brw_compile *p = &c->func;
GLuint nr_insns = c->vp->program.Base.NumInstructions;
GLuint insn, if_insn = 0;
const GLuint nr_insns = c->vp->program.Base.NumInstructions;
GLuint insn, if_depth = 0;
GLuint end_offset = 0;
struct brw_instruction *end_inst, *last_inst;
struct brw_instruction *if_inst[MAX_IFSN];
struct brw_indirect stack_index = brw_indirect(0, 0);
struct brw_instruction *if_inst[MAX_IF_DEPTH];
const struct brw_indirect stack_index = brw_indirect(0, 0);
GLuint index;
GLuint file;
@@ -1376,15 +1410,18 @@ void brw_vs_emit(struct brw_vs_compile *c )
emit_xpd(p, dst, args[0], args[1]);
break;
case OPCODE_IF:
assert(if_insn < MAX_IFSN);
if_inst[if_insn++] = brw_IF(p, BRW_EXECUTE_8);
assert(if_depth < MAX_IF_DEPTH);
if_inst[if_depth] = brw_IF(p, BRW_EXECUTE_8);
if_inst[if_depth]->header.predicate_control =
get_predicate(inst->DstReg.CondSwizzle);
if_depth++;
break;
case OPCODE_ELSE:
if_inst[if_insn-1] = brw_ELSE(p, if_inst[if_insn-1]);
if_inst[if_depth-1] = brw_ELSE(p, if_inst[if_depth-1]);
break;
case OPCODE_ENDIF:
assert(if_insn > 0);
brw_ENDIF(p, if_inst[--if_insn]);
assert(if_depth > 0);
brw_ENDIF(p, if_inst[--if_depth]);
break;
case OPCODE_BRA:
brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
@@ -1430,6 +1467,19 @@ void brw_vs_emit(struct brw_vs_compile *c )
"unknown");
}
/* Set the predication update on the last instruction of the native
* instruction sequence.
*
* This would be problematic if it was set on a math instruction,
* but that shouldn't be the case with the current GLSL compiler.
*/
if (inst->CondUpdate) {
struct brw_instruction *hw_insn = &p->store[p->nr_insn - 1];
assert(hw_insn->header.destreg__conditionalmod == 0);
hw_insn->header.destreg__conditionalmod = BRW_CONDITIONAL_NZ;
}
if ((inst->DstReg.File == PROGRAM_OUTPUT)
&& (inst->DstReg.Index != VERT_RESULT_HPOS)
&& c->output_regs[inst->DstReg.Index].used_in_src) {

View File

@@ -202,6 +202,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* BRW_NEW_FRAGMENT_PROGRAM */
const struct brw_fragment_program *fp =
(struct brw_fragment_program *)brw->fragment_program;
GLboolean uses_depth = (fp->program.Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0;
GLuint lookup = 0;
GLuint line_aa;
GLuint i;
@@ -263,6 +264,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
brw_wm_lookup_iz(line_aa,
lookup,
uses_depth,
key);

View File

@@ -286,6 +286,7 @@ void brw_wm_print_program( struct brw_wm_compile *c,
void brw_wm_lookup_iz( GLuint line_aa,
GLuint lookup,
GLboolean ps_uses_depth,
struct brw_wm_prog_key *key );
GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp);

View File

@@ -705,7 +705,11 @@ static void precalc_tex( struct brw_wm_compile *c,
tmpcoord,
0,
inst->SrcReg[0],
scale,
src_swizzle(scale,
SWIZZLE_X,
SWIZZLE_Y,
SWIZZLE_ONE,
SWIZZLE_ONE),
src_undef());
coord = src_reg_from_dst(tmpcoord);

View File

@@ -118,6 +118,7 @@ const struct {
void brw_wm_lookup_iz( GLuint line_aa,
GLuint lookup,
GLboolean ps_uses_depth,
struct brw_wm_prog_key *key )
{
GLuint reg = 2;
@@ -127,7 +128,7 @@ void brw_wm_lookup_iz( GLuint line_aa,
if (lookup & IZ_PS_COMPUTES_DEPTH_BIT)
key->computes_depth = 1;
if (wm_iz_table[lookup].sd_present) {
if (wm_iz_table[lookup].sd_present || ps_uses_depth) {
key->source_depth_reg = reg;
reg += 2;
}

View File

@@ -0,0 +1 @@
../intel/intel_pixel_read.c

View File

@@ -197,6 +197,11 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
GLuint used = batch->ptr - batch->map;
GLboolean was_locked = intel->locked;
if (intel->first_post_swapbuffers_batch == NULL) {
intel->first_post_swapbuffers_batch = intel->batch->buf;
drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
}
if (used == 0) {
batch->cliprect_mode = IGNORE_CLIPRECTS;
return;

View File

@@ -209,7 +209,10 @@ intel_bufferobj_get_subdata(GLcontext * ctx,
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
assert(intel_obj);
dri_bo_get_subdata(intel_obj->buffer, offset, size, data);
if (intel_obj->sys_buffer)
memcpy(data, (char *)intel_obj->sys_buffer + offset, size);
else
dri_bo_get_subdata(intel_obj->buffer, offset, size, data);
}

View File

@@ -345,6 +345,23 @@ intelDrawBuffer(GLcontext * ctx, GLenum mode)
static void
intelReadBuffer(GLcontext * ctx, GLenum mode)
{
if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
struct intel_context *const intel = intel_context(ctx);
const GLboolean was_front_buffer_reading =
intel->is_front_buffer_reading;
intel->is_front_buffer_reading = (mode == GL_FRONT_LEFT)
|| (mode == GL_FRONT);
/* If we weren't front-buffer reading before but we are now, make sure
* that the front-buffer has actually been allocated.
*/
if (!was_front_buffer_reading && intel->is_front_buffer_reading) {
intel_update_renderbuffers(intel->driContext,
intel->driContext->driDrawablePriv);
}
}
if (ctx->ReadBuffer == ctx->DrawBuffer) {
/* This will update FBO completeness status.
* A framebuffer will be incomplete if the GL_READ_BUFFER setting

View File

@@ -66,6 +66,7 @@
#define PCI_CHIP_Q45_G 0x2E12
#define PCI_CHIP_G45_G 0x2E22
#define PCI_CHIP_G41_G 0x2E32
#define PCI_CHIP_B43_G 0x2E42
#define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \
devid == PCI_CHIP_I915_GM || \
@@ -78,7 +79,8 @@
#define IS_G45(devid) (devid == PCI_CHIP_IGD_E_G || \
devid == PCI_CHIP_Q45_G || \
devid == PCI_CHIP_G45_G || \
devid == PCI_CHIP_G41_G)
devid == PCI_CHIP_G41_G || \
devid == PCI_CHIP_B43_G)
#define IS_GM45(devid) (devid == PCI_CHIP_GM45_GM)
#define IS_G4X(devid) (IS_G45(devid) || IS_GM45(devid))

View File

@@ -161,6 +161,9 @@ intelGetString(GLcontext * ctx, GLenum name)
case PCI_CHIP_G41_G:
chipset = "Intel(R) G41";
break;
case PCI_CHIP_B43_G:
chipset = "Intel(R) B43";
break;
default:
chipset = "Unknown Intel Chipset";
break;
@@ -220,7 +223,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
struct intel_renderbuffer *stencil_rb;
i = 0;
if ((intel->is_front_buffer_rendering || !intel_fb->color_rb[1])
if ((intel->is_front_buffer_rendering ||
intel->is_front_buffer_reading ||
!intel_fb->color_rb[1])
&& intel_fb->color_rb[0]) {
attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
attachments[i++] = intel_bits_per_pixel(intel_fb->color_rb[0]);
@@ -495,7 +500,8 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
if (screen->dri2.loader &&
(screen->dri2.loader->base.version >= 2)
&& (screen->dri2.loader->flushFrontBuffer != NULL)) {
&& (screen->dri2.loader->flushFrontBuffer != NULL) &&
intel->driDrawable && intel->driDrawable->loaderPrivate) {
(*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable,
intel->driDrawable->loaderPrivate);
@@ -505,7 +511,7 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
* each of N places that do rendering. This has worse performances,
* but it is much easier to get correct.
*/
if (intel->is_front_buffer_rendering) {
if (!intel->is_front_buffer_rendering) {
intel->front_buffer_dirty = GL_FALSE;
}
}
@@ -521,7 +527,27 @@ intelFlush(GLcontext * ctx)
static void
intel_glFlush(GLcontext *ctx)
{
struct intel_context *intel = intel_context(ctx);
intel_flush(ctx, GL_TRUE);
/* We're using glFlush as an indicator that a frame is done, which is
* what DRI2 does before calling SwapBuffers (and means we should catch
* people doing front-buffer rendering, as well)..
*
* Wait for the swapbuffers before the one we just emitted, so we don't
* get too many swaps outstanding for apps that are GPU-heavy but not
* CPU-heavy.
*
* Unfortunately, we don't have a handle to the batch containing the swap,
* and getting our hands on that doesn't seem worth it, so we just us the
* first batch we emitted after the last swap.
*/
if (intel->first_post_swapbuffers_batch != NULL) {
drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
intel->first_post_swapbuffers_batch = NULL;
}
}
void
@@ -787,6 +813,8 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
intel->prim.vb = NULL;
dri_bo_unreference(intel->prim.vb_bo);
intel->prim.vb_bo = NULL;
dri_bo_unreference(intel->first_post_swapbuffers_batch);
intel->first_post_swapbuffers_batch = NULL;
if (release_texture_heaps) {
/* This share group is about to go away, free our private
@@ -804,12 +832,23 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
/* free the Mesa context */
_mesa_free_context_data(&intel->ctx);
FREE(intel);
driContextPriv->driverPrivate = NULL;
}
}
GLboolean
intelUnbindContext(__DRIcontextPrivate * driContextPriv)
{
struct intel_context *intel =
(struct intel_context *) driContextPriv->driverPrivate;
/* Deassociate the context with the drawables.
*/
intel->driDrawable = NULL;
intel->driReadDrawable = NULL;
return GL_TRUE;
}

View File

@@ -191,6 +191,7 @@ struct intel_context
GLboolean ttm;
struct intel_batchbuffer *batch;
drm_intel_bo *first_post_swapbuffers_batch;
GLboolean no_batch_wrap;
unsigned batch_id;
@@ -294,6 +295,14 @@ struct intel_context
* easily.
*/
GLboolean is_front_buffer_rendering;
/**
* Track whether front-buffer is the current read target.
*
* This is closely associated with is_front_buffer_rendering, but may
* be set separately. The DRI2 fake front buffer must be referenced
* either way.
*/
GLboolean is_front_buffer_reading;
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */

View File

@@ -680,6 +680,11 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
if (rb == NULL)
continue;
if (irb == NULL) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
continue;
}
switch (irb->texformat->MesaFormat) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_RGB565:

View File

@@ -342,10 +342,8 @@ intelInitPixelFuncs(struct dd_function_table *functions)
functions->Bitmap = intelBitmap;
functions->CopyPixels = intelCopyPixels;
functions->DrawPixels = intelDrawPixels;
#ifdef I915
functions->ReadPixels = intelReadPixels;
#endif
}
functions->ReadPixels = intelReadPixels;
}
void

View File

@@ -409,6 +409,12 @@ intel_texture_bitmap(GLcontext * ctx,
return GL_FALSE;
}
if (ctx->Fog.Enabled) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glBitmap() fallback: fog\n");
return GL_FALSE;
}
/* Check that we can load in a texture this big. */
if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) ||
height > (1 << (ctx->Const.MaxTextureLevels - 1))) {

View File

@@ -0,0 +1,321 @@
/**************************************************************************
*
* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include "main/glheader.h"
#include "main/enums.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/image.h"
#include "main/bufferobj.h"
#include "main/state.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_blit.h"
#include "intel_buffers.h"
#include "intel_regions.h"
#include "intel_pixel.h"
#include "intel_buffer_objects.h"
/* For many applications, the new ability to pull the source buffers
* back out of the GTT and then do the packing/conversion operations
* in software will be as much of an improvement as trying to get the
* blitter and/or texture engine to do the work.
*
* This step is gated on private backbuffers.
*
* Obviously the frontbuffer can't be pulled back, so that is either
* an argument for blit/texture readpixels, or for blitting to a
* temporary and then pulling that back.
*
* When the destination is a pbo, however, it's not clear if it is
* ever going to be pulled to main memory (though the access param
* will be a good hint). So it sounds like we do want to be able to
* choose between blit/texture implementation on the gpu and pullback
* and cpu-based copying.
*
* Unless you can magically turn client memory into a PBO for the
* duration of this call, there will be a cpu-based copying step in
* any case.
*/
static GLboolean
do_texture_readpixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack,
struct intel_region *dest_region)
{
#if 0
struct intel_context *intel = intel_context(ctx);
intelScreenPrivate *screen = intel->intelScreen;
GLint pitch = pack->RowLength ? pack->RowLength : width;
__DRIdrawablePrivate *dPriv = intel->driDrawable;
int textureFormat;
GLenum glTextureFormat;
int destFormat, depthFormat, destPitch;
drm_clip_rect_t tmp;
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
if (ctx->_ImageTransferState ||
pack->SwapBytes || pack->LsbFirst || !pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
return GL_FALSE;
}
intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel));
if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: couldn't set dest %s/%s\n",
__FUNCTION__,
_mesa_lookup_enum_by_nr(type),
_mesa_lookup_enum_by_nr(format));
return GL_FALSE;
}
LOCK_HARDWARE(intel);
if (intel->driDrawable->numClipRects) {
intel->vtbl.install_meta_state(intel);
intel->vtbl.meta_no_depth_write(intel);
intel->vtbl.meta_no_stencil_write(intel);
if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
UNLOCK_HARDWARE(intel);
SET_STATE(i830, state);
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
return GL_TRUE;
}
y = dPriv->h - y - height;
x += dPriv->x;
y += dPriv->y;
/* Set the frontbuffer up as a large rectangular texture.
*/
intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat);
intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat);
/* Set the 3d engine to draw into the destination region:
*/
intel->vtbl.meta_draw_region(intel, dest_region);
intel->vtbl.meta_draw_format(intel, destFormat, depthFormat); /* ?? */
/* Draw a single quad, no cliprects:
*/
intel->vtbl.meta_disable_cliprects(intel);
intel->vtbl.draw_quad(intel,
0, width, 0, height,
0x00ff00ff, x, x + width, y, y + height);
intel->vtbl.leave_meta_state(intel);
}
UNLOCK_HARDWARE(intel);
intel_region_wait_fence(ctx, dest_region); /* required by GL */
return GL_TRUE;
#endif
return GL_FALSE;
}
static GLboolean
do_blit_readpixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
struct intel_context *intel = intel_context(ctx);
struct intel_region *src = intel_readbuf_region(intel);
struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
GLuint dst_offset;
GLuint rowLength;
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s\n", __FUNCTION__);
if (!src)
return GL_FALSE;
if (dst) {
/* XXX This validation should be done by core mesa:
*/
if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
return GL_TRUE;
}
}
else {
/* PBO only for now:
*/
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - not PBO\n", __FUNCTION__);
return GL_FALSE;
}
if (ctx->_ImageTransferState ||
!intel_check_blit_format(src, format, type)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - bad format for blit\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: bad packing params\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->RowLength > 0)
rowLength = pack->RowLength;
else
rowLength = width;
if (pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
return GL_FALSE;
}
else {
rowLength = -rowLength;
}
/* XXX 64-bit cast? */
dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
format, type, 0, 0, 0);
/* Although the blits go on the command buffer, need to do this and
* fire with lock held to guarentee cliprects are correct.
*/
intelFlush(&intel->ctx);
LOCK_HARDWARE(intel);
if (intel->driDrawable->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;
int nbox = dPriv->numClipRects;
drm_clip_rect_t *box = dPriv->pClipRects;
drm_clip_rect_t rect;
drm_clip_rect_t src_rect;
int i;
src_rect.x1 = dPriv->x + x;
src_rect.y1 = dPriv->y + dPriv->h - (y + height);
src_rect.x2 = src_rect.x1 + width;
src_rect.y2 = src_rect.y1 + height;
for (i = 0; i < nbox; i++) {
if (!intel_intersect_cliprects(&rect, &src_rect, &box[i]))
continue;
intelEmitCopyBlit(intel,
src->cpp,
src->pitch, src->buffer, 0, src->tiling,
rowLength, dst_buffer, dst_offset, GL_FALSE,
rect.x1,
rect.y1,
rect.x1 - src_rect.x1,
rect.y2 - src_rect.y2,
rect.x2 - rect.x1, rect.y2 - rect.y1,
GL_COPY);
}
}
UNLOCK_HARDWARE(intel);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
return GL_TRUE;
}
void
intelReadPixels(GLcontext * ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
intelFlush(ctx);
#ifdef I915
if (do_blit_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
if (do_texture_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
#else
(void)do_blit_readpixels;
(void)do_texture_readpixels;
#endif
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
/* Update Mesa state before calling down into _swrast_ReadPixels, as
* the spans code requires the computed buffer states to be up to date,
* but _swrast_ReadPixels only updates Mesa state after setting up
* the spans code.
*/
if (ctx->NewState)
_mesa_update_state(ctx);
_swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
}

View File

@@ -114,6 +114,13 @@ intel_region_alloc(struct intel_context *intel,
{
dri_bo *buffer;
/* If we're untiled, we have to align to 2 rows high because the
* data port accesses 2x2 blocks even if the bottom row isn't to be
* rendered, so failure to align means we could walk off the end of the
* GTT and fault.
*/
height = ALIGN(height, 2);
if (expect_accelerated_upload) {
buffer = drm_intel_bo_alloc_for_render(intel->bufmgr, "region",
pitch * cpp * height, 64);

View File

@@ -305,7 +305,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
dri_bufmgr_destroy(intelScreen->bufmgr);
intelUnmapScreenRegions(intelScreen);
driDestroyOptionCache(&intelScreen->optionCache);
driDestroyOptionInfo(&intelScreen->optionCache);
FREE(intelScreen);
sPriv->private = NULL;
@@ -617,10 +617,10 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
/* Otherwise, use the classic buffer manager. */
if (intelScreen->bufmgr == NULL) {
if (gem_disable) {
fprintf(stderr, "GEM disabled. Using classic.\n");
_mesa_warning(NULL, "GEM disabled. Using classic.");
} else {
fprintf(stderr, "Failed to initialize GEM. "
"Falling back to classic.\n");
_mesa_warning(NULL,
"Failed to initialize GEM. Falling back to classic.");
}
if (intelScreen->tex.size == 0) {

View File

@@ -283,12 +283,12 @@ radeonFillInModes( __DRIscreenPrivate *psp,
* with a stencil buffer. It will be a sw fallback, but some apps won't
* care about that.
*/
stencil_bits_array[0] = 0;
stencil_bits_array[0] = stencil_bits;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
msaa_samples_array[0] = 0;
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
depth_buffer_factor = (stencil_bits == 0) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
if (pixel_bits == 16) {

View File

@@ -902,7 +902,6 @@ EXPORTS
_mesa_generate_mipmap
_mesa_get_compressed_teximage
_mesa_get_current_context
_mesa_get_program_register
_mesa_get_teximage
_mesa_init_driver_functions
_mesa_init_glsl_driver_functions

View File

@@ -1040,7 +1040,7 @@ _mesa_MapBufferARB(GLenum target, GLenum access)
ASSERT(ctx->Driver.MapBuffer);
bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj );
if (!bufObj->Pointer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)");
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");
}
bufObj->Access = access;

View File

@@ -110,10 +110,8 @@ extern "C" {
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
# define __WIN32__
# define finite _finite
#endif
#if defined(__WATCOMC__)
#elif defined(__WATCOMC__)
# define finite _finite
# pragma disable_message(201) /* Disable unreachable code warnings */
#endif
@@ -135,6 +133,10 @@ extern "C" {
# endif
# endif
#endif
#if defined(__WATCOMC__)
# pragma disable_message(201) /* Disable unreachable code warnings */
#endif
/**

View File

@@ -138,9 +138,14 @@
/**
* Maximum viewport/image width. Must accomodate all texture sizes too.
*/
#define MAX_WIDTH 4096
#ifndef MAX_WIDTH
# define MAX_WIDTH 4096
#endif
/** Maximum viewport/image height */
#define MAX_HEIGHT 4096
#ifndef MAX_HEIGHT
# define MAX_HEIGHT 4096
#endif
/** Maxmimum size for CVA. May be overridden by the drivers. */
#define MAX_ARRAY_LOCK_SIZE 3000

File diff suppressed because it is too large Load Diff

View File

@@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit)
const GLuint newenabled = (!state)
? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit);
if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled)
if (texUnit->Enabled == newenabled)
return GL_FALSE;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
/* GL_EXT_depth_bounds_test */
case GL_DEPTH_BOUNDS_TEST_EXT:
CHECK_EXTENSION(EXT_depth_bounds_test, cap);
if (state && ctx->DrawBuffer->Visual.depthBits == 0) {
_mesa_warning(ctx,
"glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer");
return;
}
if (ctx->Depth.BoundsTest == state)
return;
FLUSH_VERTICES(ctx, _NEW_DEPTH);

View File

@@ -404,6 +404,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx)
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
ctx->Extensions.ARB_point_sprite = GL_TRUE;
ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
#if FEATURE_ARB_shader_objects
ctx->Extensions.ARB_shader_objects = GL_TRUE;

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