Ian Romanick [Wed, 15 Apr 2009 22:12:48 +0000 (15 15:12 -0700)]
intel: Bump driver date
Ian Romanick [Wed, 15 Apr 2009 22:10:09 +0000 (15 15:10 -0700)]
docs: more bug fixes for Mesa 7.4.1
Brian Paul [Wed, 15 Apr 2009 14:02:38 +0000 (15 08:02 -0600)]
glx: added null pointer check in glXGetFBConfigs()
Fixes segfault seen with glxinfo with NVIDIA OpenGL.
(cherry picked from master, commit
05471828dc8dd4a184d4467b66e9c08449d1d4c9)
Ian Romanick [Sat, 11 Apr 2009 21:02:33 +0000 (11 14:02 -0700)]
DRI2: Don't fault on NULL DrawBuffer
It is possible for ctx->DrawBuffer to be NULL, so don't fault when
that happens. This change is not being committed to master because it
doesn't appear to be necessary there.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Sun, 8 Feb 2009 14:26:30 +0000 (8 15:26 +0100)]
dri2: Don't crash if the server returns more buffers than expected.
(cherry picked from commit
f967e8b507990f0d7986e0f83924e6587d70200d)
Ian Romanick [Tue, 7 Apr 2009 18:23:10 +0000 (7 11:23 -0700)]
intel / DRI2: Accept fake front-buffer from loader
Handle the loader returning a fake front-buffer. Since the driver
never specifically requests a fake front-buffer, the driver assumes
that it will never receive both a fake and a real front-buffer.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
(cherry picked from commit
6a6e478e5555714226c6f15c63c393f5c0d74de4)
Ian Romanick [Mon, 6 Apr 2009 22:35:37 +0000 (6 15:35 -0700)]
DRI2: Assume that there is always a front buffer
Assume that the front-buffer exists even if the server didn't tell the
client that it exists.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
(cherry picked from commit
e6386e0d9a461e7bc96ae7137de9c0a33f24c1a4)
Ian Romanick [Mon, 6 Apr 2009 20:15:54 +0000 (6 13:15 -0700)]
intel / DRI2: Track and flush front-buffer rendering
Track two flags: whether or not front-buffer rendering is currently
enabled and whether or not front-buffer rendering has been enabled
since the last glFlush. If the second flag is set, the front-buffer
is flushed via a loader call back. If the first flag is cleared, the
second flag is cleared at this time.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
(cherry picked from commit
43cf0d1eebb9f425e1a0e176394b64e2cb406709)
Ian Romanick [Mon, 6 Apr 2009 19:44:18 +0000 (6 12:44 -0700)]
DRI2: Provide an interface for drivers to flush front-buffer rendering
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
(cherry picked from commit
82634ee8df7328b9235abd8352d33b0b3d953600)
Brian Paul [Thu, 9 Apr 2009 16:55:06 +0000 (9 10:55 -0600)]
mesa: fix potential recursive locking deadlock in _mesa_HashWalk()
If the walk callback called _mesa_HashRemove() we'd deadlock.
(cherry picked from master, commit
deff09921563419a77bd1aad0054afa34214ed1a)
Brian Paul [Tue, 7 Apr 2009 19:44:50 +0000 (7 13:44 -0600)]
swrast: fix point rendering function selection
Need to clamp default point size to min/max range before checking if it's one.
Fixes glean pointAtten test.
(cherry picked from master, commit
228f20e324249ef25beed725a6a821e0bd0cc232)
Brian Paul [Tue, 7 Apr 2009 14:37:22 +0000 (7 08:37 -0600)]
docs: more bug fixes for Mesa 7.4.1
Brian Paul [Fri, 3 Apr 2009 21:42:14 +0000 (3 15:42 -0600)]
mesa: in mesa_add_named_constant(), avoid adding duplicate constants
(cherry picked from master, commit
80197a0c1bec48e3731bca975ec451d96f35f62a)
Brian Paul [Tue, 7 Apr 2009 14:34:32 +0000 (7 08:34 -0600)]
mesa: fix parameter counting in ARB vertex/fragment program parsing
Duplicated unnamed constants were getting counted more than once.
(cherry picked from master, commit
866bdd0509f665446b0fa8c29aa61c25e4be4732)
Brian Paul [Tue, 7 Apr 2009 14:34:04 +0000 (7 08:34 -0600)]
mesa: replace >= with > when testing if we've exceeded max local params
Now a program that uses 256 locals works as it should.
(cherry picked from master, commit
a4173956ebcc224b5a0d76bace07b87bdf8bed03)
Brian Paul [Tue, 7 Apr 2009 14:33:43 +0000 (7 08:33 -0600)]
mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the inverse
If _math_matrix_analyse() got called before we allocated the inverse
matrix array we could lose the flag indicating that we needed to compute
the inverse. This could happen with certain vertex shader cases.
(cherry picked from master, commit
ce461ffc5aa2ea6941d6722e8ed473cda8c17833)
Brian Paul [Tue, 7 Apr 2009 14:32:42 +0000 (7 08:32 -0600)]
mesa: for OPCODE_LIT, use _mesa_pow() instead of exp() and log()
Also, s/pow/_mesa_pow/
(cherry picked from master, commit
b8a200ac9d11c09646de9b7d3f3f64a742c6abe3)
Michel Dänzer [Mon, 6 Apr 2009 06:59:57 +0000 (6 08:59 +0200)]
radeon: Expose a 32 bit RGBA fbconfig even when the screen depth is 16.
Otherwise current xserver / libGL no longer expose a 32 bit RGBA GLX visual,
and compiz fails.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20479 .
(Cherry picked from commit
e798bf8053612516420a4ec42e2ff58433abd521)
Brian Paul [Fri, 3 Apr 2009 16:16:31 +0000 (3 10:16 -0600)]
mesa: don't normalize spot light direction until validation time
In glLight() we're only supposed to transform the direction by the modelview
matrix, not normalized it too.
(cherry picked from commit
650d147289014e8a98f65fbbcd1855b2a4f19d2f)
Roland Scheidegger [Thu, 2 Apr 2009 21:38:34 +0000 (2 23:38 +0200)]
mesa: fix TexParameter functions
premature return in TexParameterf caused mesa to never call Driver.TexParameter
breaking drivers relying on this (fix bug #20966).
While here, also fix using ctx->ErrorValue when deciding to call
Driver.TexParameter. Errors are sticky and uncleared errors thus would cause
this to no longer get called. Since we thus need return value of
set_tex_parameter[if] can also optimize this to only call when value changed.
Brian Paul [Thu, 2 Apr 2009 19:11:56 +0000 (2 13:11 -0600)]
docs: fix TXB texture unit bias error
Brian Paul [Thu, 2 Apr 2009 19:11:33 +0000 (2 13:11 -0600)]
mesa: don't call ctx->Driver.ReadPixels() if width or height is zero
(cherry picked from commit master,
7b9bf395433b5fa9d5a95186891a29d49e0b47c0)
Brian Paul [Thu, 2 Apr 2009 19:10:41 +0000 (2 13:10 -0600)]
mesa: don't call ctx->Driver.Draw/CopyPixels() if width or height is zero
(cherry picked from master, commit
f6a3f1f52a969c8d990a3a41e816af4864eea45c)
Brian Paul [Thu, 2 Apr 2009 19:09:32 +0000 (2 13:09 -0600)]
mesa: use correct tex unit lod bias for TXB instruction
(cherry picked from master, commit
1ab225017ed1ea8bd9e266d10ee56ab914bb28c1)
Brian Paul [Thu, 2 Apr 2009 19:07:53 +0000 (2 13:07 -0600)]
swrast: fix glDrawBuffer(GL_FRONT_AND_BACK)
We weren't putting the right colors into the back buffer in this mode.
(cherry picked from master, commit
9cc79fc2dcdd8e21d9616cc65a931f1f5859fc30)
Brian Paul [Wed, 1 Apr 2009 13:39:43 +0000 (1 07:39 -0600)]
docs: fix bug 20986
Brian Paul [Wed, 1 Apr 2009 13:39:26 +0000 (1 07:39 -0600)]
glsl: fix texgen state variable tokens in emit_statevars()
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays.
See bug 20986.
(cherry picked from master, commit
f8dd6594bf1d597b883af44e5d724a181c1e2b53)
Brian Paul [Tue, 31 Mar 2009 22:29:23 +0000 (31 16:29 -0600)]
docs: first 7.4.1 bug fixes
Brian Paul [Tue, 31 Mar 2009 22:28:17 +0000 (31 16:28 -0600)]
mesa: fix bug in GPU codegen for fixed-function two-sided lighting
The 'dots' register wasn't getting properly un-negated and un-swizzled
after emitting the code for back-face lighting. So, if more than one
light source was enabled, the specular exponent for the next light source
was wrong.
During execution we were evaluating pow(x, y) where y was negative instead
of positive. This led to the outcome being zero or NaN.
This fixes the occasional black triangles seen in isosurf when hacked to
enable two-sided lighting.
(cherry picked from master, commit
919f57078b289a273e0e46ee2214a9f042b11b1f)
Brian Paul [Mon, 30 Mar 2009 14:57:01 +0000 (30 08:57 -0600)]
docs: prep for Mesa 7.4.1 release notes
Jeremy Huddleston [Tue, 31 Mar 2009 21:59:28 +0000 (31 14:59 -0700)]
Updated CPU_TO_LE32 to work on darwin
Jeremy Huddleston [Tue, 31 Mar 2009 21:48:19 +0000 (31 14:48 -0700)]
Fix compiling indirect.c when GLX_DIRECT_RENDERING is not defined
Jeremy Huddleston [Fri, 6 Mar 2009 16:20:21 +0000 (6 11:20 -0500)]
Updated darwin config for when X11 is not in the same location as we're installing to
(cherry picked from commit
7817fea0b675686dd6b4c29c9a55b1304a3571d7)
Brian Paul [Sat, 28 Mar 2009 01:12:16 +0000 (27 19:12 -0600)]
docs: 7.4 release md5 sums
Brian Paul [Sat, 28 Mar 2009 00:57:39 +0000 (27 18:57 -0600)]
docs: set 7.4 release date
Brian Paul [Sat, 28 Mar 2009 00:57:23 +0000 (27 18:57 -0600)]
mesa: set VERSION=7.4
Brian Paul [Sat, 28 Mar 2009 00:57:07 +0000 (27 18:57 -0600)]
mesa: set version to 7.4
Ian Romanick [Fri, 27 Mar 2009 21:22:47 +0000 (27 14:22 -0700)]
intel: Add extra, stronger flushes around CopyTexSubImage blits
Eric Anholt [Wed, 4 Feb 2009 03:29:11 +0000 (3 19:29 -0800)]
swrast: Add support for x8r8g8b8 fbconfig.
This lets swrast produce an fbconfig suitable for the root visual now that
the server's not allowing mismatched fbconfigs.
(cherry picked from commit
529d1d720e1422bad1880ef33fae1c9423112d2e)
Ian Romanick [Thu, 26 Mar 2009 22:32:29 +0000 (26 15:32 -0700)]
Mark current bits as 2009Q1-RC2 for Intel driver.
Eric Anholt [Mon, 23 Mar 2009 23:29:31 +0000 (23 16:29 -0700)]
i965: Fix glFrontFacing in twoside GLSL demo.
This also cuts instructions by just using the existing bit in the payload
rather than computing it from the determinant in the SF unit and passing it
as a varying down to the WM. Something still goes wrong with getting the
backface color right, but a simpler shader appears to get the right result.
(cherry picked from commit
699db6d842c52d0b3b98b320f8ef1104a65fa783)
Eric Anholt [Tue, 24 Mar 2009 05:35:03 +0000 (23 22:35 -0700)]
i965: Fix fog coordinate g,b,a values when glFrontFacing isn't used.
Previously, we would sample (f,glFrontFacing,undef,undef) instead of the
(f,0,0,1) that fragment.fogcoord is supposed to return. Due to
glFrontFacing's presence in FOGC.y, we'll still give bad results there when
glFrontFacing is used.
Bug #19122, piglit testcase fp-fog.
(cherry picked from commit
411d913ccea362dbd75411266d7abb685214ee93)
Eric Anholt [Tue, 24 Mar 2009 05:30:12 +0000 (23 22:30 -0700)]
i965: Clean up a bit of mess with unneeded variables in emit_interp.
(cherry picked from commit
b013f945d8514ed827183a4cbfbc4dccc100704f)
Brian Paul [Fri, 20 Feb 2009 19:23:25 +0000 (20 12:23 -0700)]
i965: separate emit_op() and emit_tex_op() functions
(cherry picked from commit
a79186e29efebed04c927d024b013435e7ff5725)
Brian Paul [Wed, 28 Jan 2009 21:48:41 +0000 (28 14:48 -0700)]
i965: minor clean-up, comments, etc.
(cherry picked from commit
9e7903e492ad842481a166484e0474dd4f3100ba)
Brian Paul [Thu, 26 Mar 2009 03:08:21 +0000 (25 21:08 -0600)]
docs: mention Solaris updates in release notes
Brian Paul [Thu, 26 Mar 2009 03:06:41 +0000 (25 21:06 -0600)]
mesa: bump version to 7.4 rc2
Alan Coopersmith [Tue, 24 Mar 2009 03:35:09 +0000 (23 20:35 -0700)]
define __builtin_expect for non-gcc compilers in two more glx files
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Alan Coopersmith [Mon, 23 Mar 2009 23:51:54 +0000 (23 16:51 -0700)]
mklib improvements for Solaris
Move flags for linking standard C/C++ libraries from configure.ac to mklib
Use -norunpath flag when linking with Sun C++ compiler
Convert mklib -exports list into a linker mapfile
Set FINAL_LIBS correctly when -noprefix is used
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Michel Dänzer [Wed, 25 Mar 2009 14:53:28 +0000 (25 15:53 +0100)]
Revert "dri2: Avoid round-tripping on DRI2GetBuffers for the same set of buffers."
This scheme breaks when the display connection doesn't receive ConfigureNotify
events. This caused reporoducible problems (cropped / misplaced output) when
starting a 3D application in a guest operating system in VMware Workstation.
This reverts commit
dd1c68f15123a889a3ce9d2afe724e272d163e32.
Conflicts:
src/glx/x11/dri2_glx.c
(cherry picked from commit
11da7e02aa3dba192aa3d95e9debec620133a41c)
Brian Paul [Wed, 25 Mar 2009 14:35:15 +0000 (25 08:35 -0600)]
docs: update glext.h to version 48
Brian Paul [Wed, 25 Mar 2009 14:35:02 +0000 (25 08:35 -0600)]
gl: update include/GL/glext.h to version 48
Brian Paul [Tue, 24 Mar 2009 22:09:23 +0000 (24 16:09 -0600)]
demos: add LDFLAGS for corender target, bug 20844
(cherry picked from commit
c4c4358e0858fcbc09f4bf35d93f593af5bcd9db)
Eric Anholt [Mon, 23 Mar 2009 19:29:02 +0000 (23 12:29 -0700)]
i965: Fix occlusion query when no other WM state updates occur.
Turns out that XXX comment was important. We weren't flagging the WM to
re-update with the statistics enable, so we got zeroes out of our query.
Bug #20740, fixes piglit occlusion_query test.
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit
c0d6e07909733af054cc592e2cfc6212155b0a9e)
Tom Fogal [Mon, 23 Feb 2009 15:20:38 +0000 (23 08:20 -0700)]
mesa: fix _glxapi_get_proc_address() for mangled names
(cherry picked from commit
7399d56ec6019e00297eef57f802a53698baa8ad)
Brian Paul [Sat, 21 Feb 2009 23:07:52 +0000 (21 16:07 -0700)]
glapi: update find_entry() for mangled names
(cherry picked from commit
4447fddc82a2c0245e798c90492293d875d186d0)
Brian Paul [Sat, 21 Feb 2009 23:01:54 +0000 (21 16:01 -0700)]
mesa: regenerated gl_mange.h file
(cherry picked from commit
fe0ccf323daba2a5e2f0d9936477c73db044190a)
Brian Paul [Mon, 23 Mar 2009 14:27:00 +0000 (23 08:27 -0600)]
mesa: remove unused 'out' label
Brian Paul [Mon, 23 Mar 2009 14:18:48 +0000 (23 08:18 -0600)]
Add Solaris to OS'es using PROT_EXEC mmap() to get executable heap space
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from master, commit
a06dd4de8756d7ebe99ed414c8d8dca5083241b8)
Brian Paul [Fri, 20 Mar 2009 23:34:54 +0000 (20 17:34 -0600)]
docs: prep for 7.4 release
Brian Paul [Fri, 20 Mar 2009 23:26:04 +0000 (20 17:26 -0600)]
mesa: prep for 7.4-rc1 release
Brian Paul [Fri, 20 Mar 2009 14:49:14 +0000 (20 08:49 -0600)]
r300: don't crash on sw tcl hw if point size vertex attrib is sent
(cherry picked from master, commit
005ad1a71d8de318a69ba18d896677d89602e0db)
Brian Paul [Mon, 9 Feb 2009 20:58:32 +0000 (9 13:58 -0700)]
mesa: avoid setting texObj->_Complete = GL_FALSE when there's no state change
Avoid a little bit of unneeded state validation and fixes a bug where the
texture complete flags was set to false, but we didn't signal _NEW_TEXTURE.
Fixes piglit tex1d-2dborder failure.
(cherry picked from commit
aad3f546a046fe40b771e5d5f965b29189821d51)
Brian Paul [Mon, 9 Feb 2009 20:50:36 +0000 (9 13:50 -0700)]
mesa: add no-change testing for a few more texture parameters
(cherry picked from commit
37c768b36aad22ecad48c7caab272354383e26a7)
Robert Ellison [Thu, 12 Mar 2009 17:46:31 +0000 (12 11:46 -0600)]
i965: fix polygon stipple when rendering to FBO
The polygon stipple pattern, like the viewport and the
polygon face orientation, must be inverted on the i965
when rendering to a FBO (which itself has an inverted pixel
coordinate system compared to raw Mesa).
In addition, the polygon stipple offset, which orients
the stipple to the window system, disappears when rendering
to an FBO (because the window system offset doesn't apply,
and there's no associated FBO offset).
With these fixes, the conform triangle and polygon stipple
tests pass when rendering to texture.
(cherry picked from commit
29309b45b011b4c44721b8f7346272fb22a4d4c2)
Robert Ellison [Wed, 11 Mar 2009 22:27:38 +0000 (11 16:27 -0600)]
i965: fix polygon face orientation when rendering to FBO
In the i965, the FBO coordinate system is inverted from the standard
OpenGL/Mesa coordinate system; that means that the viewport and the
polygon face orientation have to be inverted if rendering to a FBO.
The viewport was already being handled correctly; but polygon face
was not. This caused a conform failure when rendering to texture with
two-sided lighting enabled.
This fixes the problem in the i965 driver, and adds to the comment about
the gl_framebuffer "Name" field so that this isn't a surprise to other
driver writers.
(cherry picked from commit
6dceeb2eb804d708639d68a13a924d65f366458a)
Brian Paul [Tue, 17 Mar 2009 16:34:45 +0000 (17 10:34 -0600)]
swrast: use better _swrast_compute_lambda() function
The MAX-based function can produce values that are non-monotonic for a span
which causes glitches in texture filtering. The sqrt-based one avoids that.
This is perhaps slightly slower than before, but the difference
probably isn't noticable given we're doing software mipmap filtering.
Issue reported by Nir Radian <nirr@horizonsemi.com>
(cherry picked from master, commit
c334ce273e946733928339b1c7f9a02ccdef1b4b)
Ian Romanick [Mon, 16 Mar 2009 20:39:32 +0000 (16 13:39 -0700)]
Mark current bits as 2009Q1-RC1 for Intel driver.
Brian Paul [Thu, 5 Mar 2009 22:08:36 +0000 (5 15:08 -0700)]
i965: init dest reg CondMask = COND_TR (the proper default)
Plus fix up a debug printf.
(cherry picked from commit
20f49252e1fe2e72bb620c26292f33d5315452a1)
Brian Paul [Fri, 20 Feb 2009 18:42:28 +0000 (20 11:42 -0700)]
glsl: fix vec4_texp_rect IR code (need projective version) (cherry picked from commit
ad2cfa41992d0676881440596c43ab6021c1b025)
Brian Paul [Fri, 6 Mar 2009 23:00:25 +0000 (6 16:00 -0700)]
i965: check if we run out of GRF/temp registers
Before this change we would up emitting instructions with invalid register
numbers. This typically (but not always) hung the GPU. For now, just
prevent emitting bad instructions to avoid hangs. Still need to do some
kind of proper error recovery.
(cherry picked from commit
e60b3067d81319236d63ad497e70658fd2e14eb3)
Brian Paul [Thu, 22 Jan 2009 17:32:08 +0000 (22 10:32 -0700)]
mesa: added _mesa_fprintf() wrapper (cherry picked from commit
596b8fbbbf65cef227ce60216a57d4bbfd627099)
Brian Paul [Fri, 6 Mar 2009 00:23:42 +0000 (5 17:23 -0700)]
i965: fix emit_math1() function used for scalar instructions
Instructions such as RCP, RSQ, LOG must smear the result of the function
across the dest register's X, Y, Z and W channels (subject to write masking).
Before this change, only the X component was getting written.
Among other things, this fixes cube map texture sampling in GLSL shaders
(since cube lookups involve normalizing the texcoord).
(cherry picked from commit
348580197802406fc36219dc3f1ab90fbb8f4717)
Brian Paul [Sat, 14 Feb 2009 00:17:52 +0000 (13 17:17 -0700)]
i965: rewrite the code for handling shader subroutine calls
Previously, the prog_instruction::Data field was used to map original Mesa
instructions to brw instructions in order to resolve subroutine calls. This
was a rather tangled mess. Plus it's an obstacle to implementing dynamic
allocation/growing of the instruction buffer (it's still a fixed size).
Mesa's GLSL compiler emits a label for each subroutine and CAL instruction.
Now we use those labels to patch the subroutine calls after code generation
has been done. We just keep a list of all CAL instructions that needs patching
and a list of all subroutine labels. It's a simple matter to resolve them.
This also consolidates some redundant post-emit code between brw_vs_emit.c and
brw_wm_glsl.c and removes some loops that cleared the prog_instruction::Data
fields at the end.
Plus, a bunch of new comments.
(cherry picked from commit
c51c822ee02cb47ddba46da668577d51b7c02831)
Eric Anholt [Fri, 6 Mar 2009 07:32:00 +0000 (5 23:32 -0800)]
intel: Fix bpp setting of blits to 8bpp targets.
This was causing hangs in cairogears, as we would blit to the 8bpp target
(A8 texture) as 16bpp, and stomp over state objects.
(cherry picked from commit
19e134051c1025bbfe3838108492d705ab2b5b8b)
Robert Ellison [Wed, 4 Mar 2009 23:48:51 +0000 (4 16:48 -0700)]
i965: add software fallback for conformant 3D textures and GL_CLAMP
The i965 hardware cannot do GL_CLAMP behavior on textures; an earlier
commit forced a software fallback if strict conformance was required
(i.e. the INTEL_STRICT_CONFORMANCE environment variable was set) and
2D textures were used, but it was somewhat flawed - it could trigger
the software fallback even if 2D textures weren't enabled, as long
as one texture unit was enabled.
This fixes that, and adds software fallback for GL_CLAMP behavior with
1D and 3D textures.
It also adds support for a particular setting of the INTEL_STRICT_CONFORMANCE
environment variable, which forces software fallbacks to be taken *all*
the time. This is helpful with debugging. The value is:
export INTEL_STRICT_CONFORMANCE=2
(cherry picked from commit
34683150878e0af0859c94d0c1f0c4bf8395b042)
Brian Paul [Mon, 2 Mar 2009 19:27:16 +0000 (2 12:27 -0700)]
mesa: don't draw arrays if vertex position array is not enabled
For regular GL, we must have vertex positions in order to draw. But ES2
doesn't have that requirement (positions can be computed from any array
of data).
See bug 19911.
(cherry picked from commit
97dd2ddbd97ba95e8bc8ab572ec05e8081556e1e)
Robert Ellison [Fri, 27 Feb 2009 07:21:07 +0000 (27 00:21 -0700)]
i965: texture fixes: bordered textures, fallback rendering
i965 doesn't natively support GL_CLAMP; it treats it like
GL_CLAMP_TO_EDGE, which fails conformance tests.
This fix adds a clause to the check_fallbacks() test to check
whether GL_CLAMP is in use on any enabled 2D texture. If so,
and if strict conformance is required (via INTEL_STRICT_CONFORMANCE),
a software fallback is mandated.
In addition, validate textures *before* checking for fallbacks,
rather than after; otherwise, the texture state is never validated
and can't be trusted. (In particular, if texturing is enabled and
the sampler would access any level beyond level 0 of a texture, the
sampler will segfault, because texture validation sets the firstLevel
and lastLevel fields of a texture object so that the valid levels
will be mapped and accessed correctly. If texture validation doesn't
occur, only level 0 is accessed correctly, and that only because
firstLevel and lastLevel happen to be set to 0.)
(cherry picked from commit
17c7852bf93c4d4edf0c2cf0bdc553d399e2f51a)
Dave Airlie [Sun, 22 Feb 2009 00:37:54 +0000 (22 10:37 +1000)]
texmem: fix typo from brianp's changes.
Reported by cjb via tinderbox on irc
(cherry picked from commit
487a55af7864a3b16531af5481aab7f585622e4a)
Brian Paul [Sat, 21 Feb 2009 21:53:25 +0000 (21 14:53 -0700)]
mesa: use an array for current texture objects
Use loops to consolidate lots of texture object code.
(cherry picked from commit
9818734e0148510967ca9ee0d1aa8b196b509f02)
Brian Paul [Sat, 21 Feb 2009 20:59:29 +0000 (21 13:59 -0700)]
mesa: use an array for default texture objects
Replace Default1D/2D/3D/Cube/etc with DefaultTex[TEXTURE_x_INDEX].
The same should be done with the Current1D/2D/3D/etc pointers...
(cherry picked from commit
4d24b639d160fe485a3e8f7395e7654538be29e0)
Robert Ellison [Thu, 12 Feb 2009 01:01:34 +0000 (11 18:01 -0700)]
Fix an i965 assertion failure on glClear()
While running conform with render-to-texture:
conform -d 33 -v 2 -t -direct
the i965 driver failed this assertion:
intel_clear.c:77: intel_clear_tris: Assertion `(mask & ~((1 << BUFFER_BACK_LEFT) | (1 << BUFFER_FRONT_LEFT) | (1 << BUFFER_DEPTH) | (1 << BUFFER_STENCIL))) == 0' failed.
The problem is that intel_clear_tris() is called by intelClear() to
clear any and all of the available color buffers, but intel_clear_tris()
actually only handles the back left and front left color buffers; so
the assertion fails as soon as you try to clear a non-standard color
buffer.
The fix is to have intelClear() only call intel_clear_tris() with
buffers that intel_clear_tris() can support. intelClear() already backs
down to _swrast_Clear() for all buffers that aren't handled explicitly.
(cherry picked from commit
0ccbc3c905f0594a35d72887a1f115e148aaa596)
Brian Paul [Fri, 20 Feb 2009 17:47:28 +0000 (20 10:47 -0700)]
intel: fix datatype typo, s/GLboolean/GLuint/
Fixes mysterious failures in glean glsl1 test.
(cherry picked from commit
da2b661ee45a2754bab06359477428ef7df570ca)
Kristian Høgsberg [Fri, 13 Feb 2009 16:05:54 +0000 (13 11:05 -0500)]
intel: Fix intelSetTexBuffer miptree leak.
The intelImage also holds a reference to the miptree, so unref that as well.
(cherry picked from commit
5b354d39d466e3a463c6766fe06f737aa6e6b7bd)
Eric Anholt [Wed, 18 Feb 2009 19:34:47 +0000 (18 11:34 -0800)]
intel: tell libdrm whether we want a cpu-ready or gpu-ready BO for regions.
This lets us avoid allocing new buffers for renderbuffers, finalized miptrees,
and PBO-uploaded textures when there's an unreferenced but still active one
cached, while also avoiding CPU waits for batchbuffers and CPU-uploaded
textures. The size of BOs allocated for a desktop running current GL
cairogears on i915 is cut in half with this.
Note that this means we require libdrm 2.4.5.
(cherry picked from commit
40dd024be618d805b3744e15d25e115018641324)
Eric Anholt [Thu, 19 Feb 2009 21:53:46 +0000 (19 13:53 -0800)]
i965: Fix render target read domains.
We were asking for something illegal (write_domain != 0 && read_domains !=
write_domain) because at the time of writing the region surfaces were used
for texturing occasionally as well, and we weren't really clear on the model
GEM was going to use.
This reliably triggered a kernel bug with domain handling, resulting in
oglconform mustpass.c failure. Of course, it only became visible after
01bc4d441fd6821ad9fc20d5e9544e4e587e4ff0 cleaned up some gratuitous flushing.
(cherry picked from commit
078e8a61b2aa547c6794f586a5c8bfaa575bb066)
Eric Anholt [Mon, 9 Feb 2009 23:55:15 +0000 (9 15:55 -0800)]
intel: Don't do the extra MI_FLUSH in flushing except when doing glFlush().
Everything other than "make sure the last rendering ends up visible on the
screen" doesn't need that behavior.
(cherry picked from commit
01bc4d441fd6821ad9fc20d5e9544e4e587e4ff0)
Eric Anholt [Sun, 8 Feb 2009 14:39:51 +0000 (8 15:39 +0100)]
intel: don't crash when dri2 tells us about buffers we don't care about. (cherry picked from commit
f82f1ffba9f2e5971a6a3f3927ae3b22b798bab2)
Eric Anholt [Sun, 8 Feb 2009 14:22:34 +0000 (8 15:22 +0100)]
dri2: Initialize variables for the getbuffers round-trip reduction.
Missed setting the initial values which usually didn't hurt at runtime.
(cherry picked from commit
680c708deeb4d18474cf7ba86c587dede51d3633)
Eric Anholt [Tue, 17 Feb 2009 18:53:37 +0000 (17 10:53 -0800)]
intel: Fix tri clear to do FBO color attachments as well.
This is a 2% win in fbo_firecube, and would avoid a sw fallback for
masked clears.
(cherry picked from commit
fd51cf1531f1630ee1cb154b3b7fefad9ed820f1)
Eric Anholt [Tue, 17 Feb 2009 18:53:11 +0000 (17 10:53 -0800)]
i965: Fix fallback on stencil drawing to fbo when the visual lacks stencil.
Noticed this with the fbotexture demo.
(cherry picked from commit
c06f4e2a371a917cfcce47e7ee4aa8f1f6528e3b)
Brian Paul [Mon, 9 Feb 2009 19:12:09 +0000 (9 12:12 -0700)]
i965: need to disable current shader, if any, in intel_clear_tris()
Fixes bad background in all the progs/glsl/ tests.
(cherry picked from commit
60b3fe6c19eb881f6193ba46450c0c9f559a10e5)
Eric Anholt [Mon, 9 Feb 2009 13:55:31 +0000 (9 14:55 +0100)]
intel: Speed up glDrawPixels(GL_ALPHA) by using an alpha texture format. (cherry picked from commit
0b63f6449e095fa3b5ef510e1c1eadc2e0e0ea36)
Eric Anholt [Mon, 9 Feb 2009 14:25:30 +0000 (9 15:25 +0100)]
intel: Fix some state leakage of {Client,}ActiveTexture in metaops.
Found while debugging cairo-gl.
(cherry picked from commit
d11981e0d722282894b5012d37b2960ee3fbfac2)
Eric Anholt [Fri, 30 Jan 2009 22:32:23 +0000 (30 14:32 -0800)]
i965: Remove brw->attribs now that we can just always look in the GLcontext. (cherry picked from commit
052c1d66a1ab1f2665870dc77dab28d20416cdf1)
Eric Anholt [Fri, 30 Jan 2009 22:18:03 +0000 (30 14:18 -0800)]
i965: Delete old metaops code now that there are no remaining consumers. (cherry picked from commit
14321fcfde9e30d0b9f15aab3c9a057271ae6295)
Brian Paul [Sat, 24 Jan 2009 00:37:21 +0000 (23 17:37 -0700)]
i965: init array->Format fields (see bug 19708) (cherry picked from commit
628b52241b13132e2d4065b653befdf81236e651)
Eric Anholt [Fri, 30 Jan 2009 19:24:04 +0000 (30 11:24 -0800)]
intel: If we're doing a depth clear with tris, do color with it.
This is a 10% win on the ever-important glxgears not-a-benchmark.
(cherry picked from commit
67ee22c89f42146e7befb2fdd39bdd68a5258c30)
Eric Anholt [Fri, 30 Jan 2009 00:45:08 +0000 (29 16:45 -0800)]
i915: Only call CalcViewport from DrawBuffers instead of Viewport.
This saves an inadvertent round-trip to the X Server on DrawBuffers, which was
hurting some metaops.
(cherry picked from commit
ac0dfbdf0f5e5dea08ec717ae8c4e1e141b15c05)
Brian Paul [Mon, 26 Jan 2009 23:33:45 +0000 (26 16:33 -0700)]
intel: move some driver functions around
A step toward consolidating i915/intel_state.c and i965/intel_state.c
(cherry picked from commit
84c8b5bbf980deea6322009354c3331dc5d5eb57)