Compare commits

..

141 Commits

Author SHA1 Message Date
Andreas Boll
16aaa75d9f docs: Add 8.0.5 release notes
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 22:10:00 +02:00
Andreas Boll
d8571a1acf mesa: Bump version number to 8.0.5
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 21:11:11 +02:00
Brian Paul
47a509c046 mesa: fix incorrect error for glCompressedSubTexImage
If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1f586684d6)
2012-10-24 11:41:07 -07:00
Brian Paul
59b1e4a29e mesa: do internal format error checking for glTexStorage()
Turns out we weren't doing any format checking before.  Now check
the internal format and, in particular, make sure that unsized internal
formats aren't accepted.

Note: This is a candidate for the stable branches.
(cherry picked from commit 2e4fc54977)
2012-10-24 11:41:07 -07:00
Ian Romanick
9afcb18146 dri_util: Use calloc to allocate __DRIcontext
The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit f93cb0bebb)
2012-10-24 11:41:07 -07:00
Ian Romanick
1c4b61e0c2 mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT
This was already (correctly) supported for glGetSamplerParameter paths.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ae3023e967)
2012-10-24 11:41:07 -07:00
Chris Forbes
b130d42279 mesa: fix dropped && in glGetStringi()
This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d30a7d2eb4)
2012-10-24 11:41:06 -07:00
Eric Anholt
f0b188a6c6 i965: Drop the confusing saturate argument to math instruction setup.
This was ridiculous.  We were ignoring the inst->header.saturate flag in the
case of math and only math.  On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument.  On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9b4053cabd)
2012-10-24 11:41:06 -07:00
Eric Anholt
7a13920597 mesa: In conditional rendering fallback, check the query status.
Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 1b148e660e)
2012-10-24 11:41:06 -07:00
Eric Anholt
bd9f729091 mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting.  It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 4bbd120368)
2012-10-24 11:41:06 -07:00
Kenneth Graunke
6fc0ebb44a i965/fs: Don't use brw->fragment_program in calculate_urb_setup().
Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled.  Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b
on pre-Sandybridge hardware.  The actual bug was created in commit
7b1fbc6889.

NOTE: This is a candidate for the 9.0 and 8.0 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 4d9abd96cc)
2012-10-24 11:41:06 -07:00
Brian Paul
81627c7d45 st/mesa: s/CALLOC/calloc/ to fix allocation bug
The CALLOC() macro only takes one argument so this was being treated
as a comma expression.  Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
(cherry picked from commit 43ed822a50)
2012-10-24 11:41:06 -07:00
Eric Anholt
2b9a0c743a i965: Fix accumulator_contains() test to also reject swizzles of the dst.
When faced with this sequence:

	MOV	R1, c[1];
	MAD	R0, R2, R1.x, R1.y;

we were concluding that the MOV of R1 set up our accumulator and so we could
just use the previous result.  Only, it's got R1.xyzw in it instead of the
r1.y we're looking for.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 6754ec831e)
2012-10-24 11:41:06 -07:00
Stéphane Marchesin
bb2fa7ef06 glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field
When too may uniforms are used, the error will be caught in
check_resources (src/glsl/linker.cpp).

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
(cherry picked from commit ff996cafce)
2012-10-24 11:41:06 -07:00
Ian Romanick
b75d5c671f mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
Also validate glCopyTexImage border.  This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 0686ccac95)
2012-10-24 11:41:06 -07:00
Ian Romanick
7e7f7a32c2 mesa: Generate an error when glCopyTexImage border is invalid
NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 59d965333c)
2012-10-24 11:41:05 -07:00
Brian Paul
93aa04bc82 mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image
This seems to be expected by the WebGL texture-mips test.  The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit f6b7157550)
2012-10-24 11:41:05 -07:00
Niels Ole Salscheider
64330801bb st/mesa: index can be negative in the PROGRAM_CONSTANT case
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8cc1860d4a)
2012-10-24 11:41:05 -07:00
Marek Olšák
0504ee8f35 gallium/u_blit: set dst format from pipe_resource, not pipe_surface
We use it to decide whether we can use resource_copy_region.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit b7c4ee21c5)
2012-10-24 11:41:05 -07:00
Kenneth Graunke
d98eb4b2f0 intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.
On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
some extra PIPE_CONTROLs to capture the current occlusion query data.
Unfortunately, it was being called *after* _intel_batchbuffer_flush
added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
inside the batch.

Not only does this likely cause bogus occlusion query values, it can
also cause crashes: with the recent change to use 64-bit depth count
writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
happened after the MI_NOOP padding.  This resulted in an odd-length
batch buffer, which resulted in execbuf2 returning -EINVAL and the
application dying with an intel_do_flush_locked failure.

On older generations, finish_batch() doesn't emit any state, so this
change shouldn't have any effect.

Huge thanks to Chris Wilson for helping me figure this out.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 9da50667f4)
2012-10-24 11:41:05 -07:00
Brian Paul
620a1f973b softpipe: fix softpipe_delete_fs_state() failed assertion
The var!=softpipe->fs_variant assertion was failing because we weren't
nulling the softpipe->fs_variant pointer when binding a new shader.
Since softpipe->fs_variant depends on the current fs, it's of no use
when a new FS is bound.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 16c702ef3b)
2012-10-24 11:41:05 -07:00
Brian Paul
b28f4a0abd st/mesa: fix renderbuffer validation bug
After we attach a new renderbuffer in this function we need to make
sure Mesa's update_framebuffer() gets called.

Fixes crash in WebGL conformance/textures/texture-attachment-formats.html,
but the test still fails for other reasons.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit cf77c29e60)
2012-10-24 11:41:05 -07:00
Brian Paul
1417f42904 gallivm: fix crash in lp_sampler_static_state()
Fixes WebGL conformance/uniforms/uniform-default-values.html crash.

We need to check for the null view pointer before accessing view->texture.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit f7af4beae5)
2012-10-24 11:41:05 -07:00
Brian Paul
570b551a76 st/mesa: fix glCopyTexSubImage crash
Fixes a WebGL crash.  The dest texture image is at level 2 and is of
size 1x1 texel.  The st texture image is a stand-alone resource, not
a pointer into a complete mipmap.  So the resource has one level and
trying to write to level 2 blows up.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314
and http://bugs.freedesktop.org/show_bug.cgi?id=53319

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 9b04abe368)
2012-10-24 11:41:05 -07:00
Eric Anholt
563d73a57d i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.
Fixes piglit gl-2.0/edgeflag.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b3367f56d8)
2012-10-24 11:41:05 -07:00
Ian Romanick
b8ab1f2e41 dri2: Fix bug in attribute handling for non-desktop OpenGL contexts
Previously an error would be generated if any attributes were specified when
creating a non-desktop OpenGL context.  This was a mistake, and it will
prevent old drivers from working with new EGL libraries that add support for
the createContextAttribs interface.  Instead, match the behavior of
EGL_KHR_create_context: allow versions that make sense, reject non-zero flags.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 63adb6b9ea)
2012-10-24 11:41:04 -07:00
Kenneth Graunke
4e53cb22c6 i965/vs: Don't clobber sampler message MRFs with subexpressions.
See the preceding commit for a description of the problem.

NOTE: This is a candidate for stable release branches.

v2: Use a separate dPdx variable rather than reusing the lod src_reg.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 54c045b93c)
2012-10-24 11:41:04 -07:00
Chad Versace
3053b30ddd swrast: Fix implicit declaration warnings
In a recent commit,
    commit 1c0f1dd42a
    Author: Chad Versace <chad.versace@linux.intel.com>
    swrast: Fix fixed-function fragment processing
I defined a new function,_swrast_fragment_program, but neglected
to #include s_fragprog.h for clients of that function.

Note: This is a candidate for the 8.0 branch.
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit ab1195cf11)
2012-10-24 11:41:04 -07:00
Ian Romanick
464263d613 i965: Fix regression in depth texture rendering on pre-SNB
This was introduced by commit 24db6d6 (cherry-picked from a683012).  The
original patch fixed potential GPU hangs on SNB, and it caused some
rendering regressions there.  The benefits outweigh the costs.

However, the work-around is not necessary for pre-SNB chipsets.
Applying the work-around there gives rendering regressions with no
benefit.  This patch disables the work-around on pre-SNB chipsets.

Without the original patch, the piglit test
depthstencil-render-miplevels would reliably hang an SNB GPU.  On ILK
this test would not hang, and it does not hang with this patch.

NOTE: This is a candidate for the 8.0 and 9.0 branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 5fe5aa8e55)
2012-10-24 11:41:04 -07:00
Michel Dänzer
097065f713 st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit eee1ff423c)
2012-10-24 18:14:34 +02:00
Andreas Boll
e907c13498 mesa: add get-pick-list.sh script into bin/
This is a squash of:

    mesa: add get-pick-list.sh script into bin/

    NOTE: This is a candidate for the stable branches.
    (cherry picked from commit 2d95db660e)

This is the 2nd commit message:

    mesa: simplify get-pick-list.sh script

    and add a description for the script

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit fa27a0db43)

This is the 3rd commit message:

    mesa: optimize get-pick-list.sh script

    cuts down the while loop iterations from 4600 to 380 commits at the
    moment

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit b2991526ed)

This is the 4th commit message:

    mesa: grep for commits with cherry picked in commit message only once

    and save them temporary in already_picked

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 135ec3a1db)

This is the 5th commit message:

    mesa: fix indentation in get-pick-list.sh script

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 3e3ff4cd73)
2012-10-23 19:33:37 +02:00
Marek Olšák
1c66286bd6 r600g: fix instance divisor on Cayman
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 836325bf7e)

Conflicts:

	src/gallium/drivers/r600/r600_asm.c
2012-10-19 21:53:31 +02:00
Michel Dänzer
54cc16d3d9 st/mesa: Fix source miptree level for copying data to finalized miptree.
Fixes WebGL texture mips conformance test, no piglit regressions.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit c2e37b1d2e)
2012-10-19 18:59:13 +02:00
Marek Olšák
ddcf624ac9 r600g: fix EXP on Cayman
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 96f50d0cf7)
2012-10-16 22:03:15 +02:00
Marek Olšák
b3088ccee0 r600g: fix RSQ of negative value on Cayman
NOTE: This is a candidate for the stable branches.
(cherry picked from commit fd5c538464)
2012-10-16 22:03:05 +02:00
Vadim Girlin
8f89e44365 winsys/radeon: fix relocs caching
Don't cache pointers to elements of reallocatable array.
In some circumstances it caused false cache hits resulting in incorrect
command stream and gpu lockup.

Note: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 9aa8bac98b)
2012-10-16 22:02:47 +02:00
Marek Olšák
bc88231530 r300g: fix colormask with non-BGRA formats
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 1e51d368eb)
2012-10-16 22:02:01 +02:00
Alex Deucher
46d39db6f1 r600g: add additional evergreen pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a6146d2566)
2012-10-16 21:59:47 +02:00
Alex Deucher
a8f95de936 r600g: add new Sumo, Palm, BTC pci ids
Note this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6ce298f9ce)
2012-10-16 21:58:54 +02:00
Alex Deucher
0c597717d9 r600g: 8.0.x support for Trinity
This is a backport of the following commits from master:
b4082f492b
75f9d24ac4

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-16 21:58:23 +02:00
Brian Paul
06e174191d radeon: fix Base/base typo
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52563
(cherry picked from commit 38184dcd54)
2012-10-14 20:57:27 +02:00
Eric Anholt
d7cc01fbf8 i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.
Fixes some failures in getteximage-formats.

v2: Remove stray include, and drop extra test for encoding == GL_SRGB --
    _mesa_get_srgb_format_linear() returns the same format if it wasn't SRGB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48120
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 19bd5936af)

Conflicts:

	src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2012-10-12 20:07:42 -07:00
Kenneth Graunke
52fbb8537a glsl: Fix #pragma invariant(all) language version check.
It was using state->Const.GLSL_100ES, which is set if the driver
supports ARB_ES2_compatibility or we're in ES2 mode.  Instead, it should
use state->language_version, as that represents the actual GLSL version
of the shader being compiled.

Since the correct logic is < 120 && !100, just make it == 110.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 03ac5c54b5)

Conflicts:

	src/glsl/glsl_parser.yy
2012-10-12 20:07:42 -07:00
Kenneth Graunke
a85dd5712f i965: Support MESA_FORMAT_SIGNED_RGBA_16.
The hardware supports this format with no known quirks, so we may as
well enable it.

Alpha blending is not supported until Sandybridge, but as far as I can
tell, OpenGL doesn't require alpha blending on SNORM formats.  Plus, we
already expose R8G8B8A8_SNORM which has a similar restriction.

Fixes 6 piglit texwrap-2D-*SNORM* cases,
gl-3.1/required-sized-texture-formats, and 10 oglconform snorm-textures
subcases

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f56dfc3213)
2012-10-12 20:07:42 -07:00
Christoph Bumiller
46a36334c0 st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, too
sRGBEnabled should affect both textures and renderbuffers, so we need
to check/update the pipe_surface format for both.

Fixes, for instance, rendering appearing too bright in wine applications
using sRGB multisample renderbuffers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 51e41a0d89)
2012-10-12 20:07:42 -07:00
Brian Paul
28994d8b97 meta: fix glDrawPixels fallback test, stencil drawing
Remove the check for pixel transfer ops.  If any RGB/depth scale/bias
is in effect, it'll be applied in the glTexImage step.

If drawing stencil pixels we need to disable pixel transfer so that
alpha scale/bias are not applied to the stencil data.

These issues were spotted by Roland.

Fixes Blender performance issues reported in
http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 906febaf8b)
2012-10-12 20:07:42 -07:00
Brian Paul
ea1ec0e4b8 svga: fix invalid memory reference in needs_to_create_zero()
The emit->key.fkey info is only valid if we're generating a fragment shader.
We should not look at it if we're generating a vertex shader.

When generating a vertex shader, the value of emit->key.fkey.num_textures was
garbage and the loop over num_textures would read invalid data.  At best
this would cause us to emit an unused constant.  At worse, we could segfault.
Just by dumb luck, fkey.num_textures was usually a smallish integer.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit dafa77201f)
2012-10-12 20:07:41 -07:00
Brian Paul
ebaf1edfa3 radeon: set swrast_renderbuffer::ColorType field when mapping renderbuffers
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
(cherry picked from commit 0e893b4261)
2012-10-12 20:07:41 -07:00
Brian Paul
8d6a8cd89e xlib: add X error handler around XGetImage() call
XGetImage() will generate a BadMatch error if the source window isn't
visible.  When that happens, create a new XImage.  Fixes piglit 'select'
test failures with swrast/xlib driver.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit a73e9207da)
2012-10-12 20:07:41 -07:00
Brian Paul
d6724833ed mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit
a divide by zero.  There's a check to prevent this (we basically give up on
computing the inverse and return the identity matrix.)  This patch loosens
this test to fix a lighting bug reported by Lars Henning Wendt.

v2: use abs(det) to handle negative values

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
(cherry picked from commit 50db812915)
2012-10-12 20:07:41 -07:00
Jordan Justen
7d33cf9476 intel: move error on create context to proper path
The error was being set on the non-error path, rather
than the error path.

NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 881bb4ac72)
2012-10-12 20:07:41 -07:00
Kenneth Graunke
f9aefaeb27 mesa: Prevent repeated glDeleteShader() from blowing away our refcounts.
Calling glDeleteShader() should mark shaders as pending for deletion,
but shouldn't decrement the refcount every time.  Otherwise, repeated
glDeleteShader() is not safe.

This is particularly bad since glDeleteProgram() frees shaders: if you
first call glDeleteShader() on the shaders attached to the program (thus
decrementing the refcount), then called glDeleteProgram(), it would try
to free them again (decrementing the refcount another time), causing
a refcount > 0 assertion to fail.

Similar to commit d950a778.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c3bc41011f)
2012-10-12 20:07:41 -07:00
Chad Versace
c33b752899 i830: Fix stack corruption
Found by compiler warning:
    i830_texstate.c:131:28: warning: argument to 'sizeof' in 'memset' call
          is the same expression as the destination; did you mean to
          dereference it?  [-Wsizeof-pointer-memaccess]
       memset(state, 0, sizeof(state));
              ~~~~~            ^~~~~

On 64-bit systems, memset here would write an extra 4 bytes.

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 735070c45b)
2012-10-12 20:07:41 -07:00
José Fonseca
a0ea21ff04 mesa: disable MSVC global optimization in pack.c
To reduce excessive compilation time in release mode.

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 1a8f6ac5a4)
2012-10-12 20:07:41 -07:00
Ian Romanick
454841bedd Revert "i965: Avoid unnecessary recompiles for shaders that don't use dFdy()."
This patch depends on some other patches that were not picked over.  As
a result, this patch causes a bunch of piglit regressions on SNB.

This reverts commit 55d23cfc56.
2012-10-12 20:07:41 -07:00
Jonas Maebe
59997d619d darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 5fdf1f784b)
2012-09-24 16:06:44 -07:00
Maarten Lankhorst
25da204f69 winsys/radeon: Remove unnecessary pipe_thread_destroy in radeon_drm_cs_destroy
Fixes crash bug introduced with 210ddf0819 fd.o #49198
pthread_detach after a pthread_join is unneeded.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-09-20 09:00:08 +02:00
Kenneth Graunke
77e711cfca i965/fs: Initialize output_components[] by filling it with zeros.
Prior to commit afaf5b59e, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output.  However, that broke for
smaller output types (float, vec2, or vec3).  To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.

Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.

Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).

Fixes a regression since afaf5b59e4.

Backported from master commit 6928bea7ca.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2012-09-10 13:42:20 -07:00
Chad Versace
d788066575 mesa: Don't advertise GLES extensions in GL contexts
glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.

Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit f29a4b0157)

Conflicts:
	src/mesa/main/extensions.c
2012-09-06 11:48:51 -07:00
Tapani Pälli
1b1975e3af android: do not expose single buffered eglconfigs
On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type.  This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit d58ca43b80)
2012-08-31 09:56:15 -07:00
Tapani Pälli
61badd46ba xmlconfig: use __progname when building for Android
__progname symbol and strrchr are available with bionic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 4d02b018f4)
2012-08-31 09:56:09 -07:00
Eric Anholt
59d247c829 i965: Fix bug in the old FS backend's projtex() calculation.
In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not
just texcoords.  Now that we have _mesa_vert_result_to_frag_attrib(), we can
fill in the other FS inputs with correct proj_attrib_mask info.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 13:55:07 -07:00
Kenneth Graunke
57295009e8 mesa: Use GLdouble for depthMax in final unpack conversions.
The final step of _mesa_unpack_depth_span is to take the temporary
GLfloat depth values and convert them to the desired format.  When
converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use
double-precision math to avoid overflow and precision problems.

Or at least that's the idea.  Unfortunately

   GLdouble z = depthValues[i] * (GLfloat) depthMax;

actually causes single-precision multiplication, since both operands are
GLfloats.  Casting depthMax to GLdouble causes the scaling to be done
with double-precision math.

Fixes a regression in oglconform's depth-stencil basic.read.ds test
since c60ac7b179, where the expected and
actual values differed slightly.  For example, 0xcfa7a6 vs. 0xcfa7a4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-16 23:50:28 -07:00
Andreas Boll
36fe8a5b7f mesa: fix html in shortlog_mesa.sh script
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-16 23:49:52 -07:00
Brian Paul
c12dcfd73c mesa: added Ian's shortlog_mesa.sh script in bin/ 2012-08-16 23:49:51 -07:00
Paul Berry
889cc4d922 i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen7, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>

Cherry-picked from 714b4f6184
Conflicts:

	src/mesa/drivers/dri/i965/gen7_misc_state.c

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50271
2012-08-05 08:18:20 -07:00
Paul Berry
24db6d63da i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>

Cherry-picked from a683012a80
Conflicts:

	src/mesa/drivers/dri/i965/brw_misc_state.c

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50271
2012-08-05 08:17:51 -07:00
Brian Paul
bb36936d12 st/egl: fix uninitialized pointer bug
If no format is matched in the loop the value of xconf was undefined.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit fe2a7b7e7f)
2012-07-31 12:25:50 -07:00
Marek Olšák
b4fbb0b180 mesa: remove assertions that do not allow compressed 2D_ARRAY textures
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 13b0af721a)
2012-07-31 12:25:50 -07:00
Eric Anholt
891b66b328 i965/fs: Invalidate live intervals in passes that remove an instruction.
Since live intervals are based on ip, removing an instruction trashes
the intervals unless we were to go do some surgery.  These happen to
usually remove a use of a grf, so it's time to recalculate, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 release branch.
(cherry picked from commit 2343fe9a5d)
2012-07-31 12:25:50 -07:00
Paul Berry
55d23cfc56 i965: Avoid unnecessary recompiles for shaders that don't use dFdy().
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This patch avoids unnecessarily recompiling shaders that don't use
dFdy(), by only setting render_to_fbo in the wm program key if the
shader actually uses dFdy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d08fdacd58)

Conflicts:

	src/mesa/drivers/dri/i965/brw_wm.c
2012-07-31 12:25:50 -07:00
Paul Berry
9ca7b5b65e mesa: Add UsesDFdy to struct gl_fragment_program.
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This boolean will allow it to avoid unnecessarily recompiling shaders
that don't use dFdy().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 5e310e9f83)
2012-07-31 12:25:50 -07:00
Paul Berry
c3ad361f47 i965: Compute dFdy() correctly for FBOs.
On i965, dFdx() and dFdy() are computed by taking advantage of the
fact that each consecutive set of 4 pixels dispatched to the fragment
shader always constitutes a contiguous 2x2 block of pixels in a fixed
arrangement known as a "sub-span".  So we calculate dFdx() by taking
the difference between the values computed for the left and right
halves of the sub-span, and we calculate dFdy() by taking the
difference between the values computed for the top and bottom halves
of the sub-span.

However, there's a subtlety when FBOs are in use: since FBOs use a
coordinate system where the origin is at the upper left, and window
system framebuffers use a coordinate system where the origin is at the
lower left, the computation of dFdy() needs to be negated for FBOs.

This patch modifies the fragment shader back-ends to negate the value
of dFdy() when an FBO is in use.  It also modifies the code that
populates the program key (brw_wm_populate_key() and
brw_fs_precompile()) so that they always record in the program key
whether we are rendering to an FBO or to a window system framebuffer;
this ensures that the fragment shader will get recompiled when
switching between FBO and non-FBO use.

This will result in unnecessary recompiles of fragment shaders that
don't use dFdy().  To fix that, we will need to adapt the GLSL and
NV_fragment_program front-ends to record whether or not a given shader
uses dFdy().  I plan to implement this in a future patch series; I've
left FIXME comments in the code as a reminder.

Fixes Piglit test "fbo-deriv".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 82d25963a8)
2012-07-31 12:25:50 -07:00
Brian Paul
2758505228 intel: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 4433b0302d)
2012-07-31 12:25:50 -07:00
Brian Paul
ec34868f65 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 36ede89687)
2012-07-31 12:25:50 -07:00
Eric Anholt
539a02b9a7 i965/gen7: Reduce GT1 WM thread count according to updated BSpec.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>

https://bugs.freedesktop.org/show_bug.cgi?id=52382
(cherry picked from commit fbf86c7f0f)
2012-07-27 11:42:48 -07:00
Andreas Boll
8d0fd58546 docs/relnotes-8.0.4: fix html markup
(cherry picked from commit 40742fa686)
2012-07-10 13:10:14 -07:00
Ian Romanick
1b27cc3962 docs: Add 8.0.4 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 08:45:35 -07:00
Ian Romanick
c1f4867c89 docs: Add 8.0.4 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 08:45:16 -07:00
Ian Romanick
7c2225b026 mesa: Bump version number to 8.0.4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 08:28:32 -07:00
Marek Olšák
827c99e1a0 st/mesa: don't do srgb->linear conversion in decompress_with_blit
This fixes piglit/getteximage-formats on r600g.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5e7e7d96b3)
2012-07-06 10:09:00 -07:00
Thomas Gstädtner
0d38468098 gallium/targets: pass ldflags parameter to MKLIB
Without passing the -ldflags parameter before $(LDFLAGS) in some cases
flags will be passed to MKLIB which it does not understand.
This might be -m64, -m32 or similar.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Thomas Gstädtner <thomas@gstaedtner.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 93594f38be)
2012-07-06 10:09:00 -07:00
Vinson Lee
fc3d2c4623 st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fixes uninitialized member defects reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 70d038e46e)
2012-07-06 10:09:00 -07:00
Vadim Girlin
fe5541f64c r600g: check gpr count limit
This should help to prevent gpu lockups.
See https://bugs.freedesktop.org/show_bug.cgi?id=48472

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 783e4da72a)
2012-07-06 10:09:00 -07:00
Brian Paul
1ce1a4526f st/mesa: fix max_offset computation for base vertex
Add the maximum base vertex offset to max_index for computing the
buffer size.  Fixes a failed assertion in the u_upload_mgr.c code with
the VMware svga driver.

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

v2: incorporate Marek's suggestions.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 299c9052e8)
2012-07-06 10:09:00 -07:00
Kenneth Graunke
e0e1ca353b glsl: Don't trust loop analysis in the presence of function calls.
Function calls may have side effects that alter variables used inside
the loop.  In the fragment shader, they may even terminate the shader.
This means our analysis about loop-constant or induction variables may
be completely wrong.

In general it's impossible to determine whether they actually do or not
(due to the halting problem), so we'd need to perform conservative
static analysis.  For now, it's not worth the complexity: most functions
will be inlined, at which point we can unroll them successfully.

Fixes Piglit tests:
- shaders/glsl-fs-unroll-out-param
- shaders/glsl-fs-unroll-side-effect

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0405bd08ca)
2012-07-06 10:09:00 -07:00
Brian Paul
04f7c32f78 draw: fix missing immediates bug in polygon stipple code
The function that counts the number of TGSI immediates also needs to
emit the immediates.  This fixes assorted failures when using polygon
stipple with fragment shaders that have their own immediates.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 7f16246ace)
2012-07-06 10:09:00 -07:00
Brian Paul
da8d65fde4 st/mesa: fix mipmap image size computation w.r.t. texture arrays
The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 318669f196)
2012-07-06 10:08:59 -07:00
Brian Paul
57a273d89b st/mesa: add null pointer check in st_texture_image_map()
If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it.  Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.

Fixes a crash with the upcoming piglit max-texture-size test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 03f8a97d71)
2012-07-06 10:08:59 -07:00
Brian Paul
099bc3aaea st/mesa: use private pipe_sampler_view in decompress_with_blit()
Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 0315cb9f8f)
2012-07-06 10:08:59 -07:00
Brian Paul
3539914e49 st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
The st_renderbuffer_alloc_storage() function is used to allocate both
window-system buffers and user-created renderbuffers.  The later kind
are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
those surfaces.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5a70e12fc0)
2012-07-06 10:08:59 -07:00
José Fonseca
de8bb6a59b draw: Ensure that prepare is always run after LLVM garbagge collection.
Should avoid dangling pointer derreference with

  glean --run results --overwrite --quick --tests texSwizzle

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 07635a4799)
2012-07-06 10:08:59 -07:00
Brian Paul
646ac02462 svga: reset vertex buffer offset in svga_release_user_upl_buffers()
This function releases the buffer that contains user-space vertex data.
The buffer_offset field points into that buffer.  So reset the
buffer_offset to zero when we release the buffer so that subsequent
draws don't inadvertantly get a bad offset.

Fixes error messages / failed assertions (in the draw module's bounds/size
checking code) when running piglit's polygon-mode test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 04341e51ce)
2012-07-06 10:08:59 -07:00
Brian Paul
dad7547b98 svga: move svga_texture() casts/calls in svga_surface_copy()
To fix failed assertions when calling glCopyBufferSubData().

svga_texture() asserts that the resource is a texture.  Simply move the
calls to svga_texture() after the code that handles non-texture copies
so that we don't call it with non-texture resources.

Fixes glean bufferObject failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 7f2e12812a)
2012-07-06 10:08:58 -07:00
Brian Paul
2bf8f39cc8 st/mesa: copy num_immediates field when copying the immediates array
Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area.  Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit fdae0eaf22)
2012-07-06 10:08:58 -07:00
Brian Paul
5c65bcd259 st/mesa: add fallback pipe formats for (compressed) R, RG formats
If we don't find an exact PIPE_FORMAT_x for a GL_(COMPRESSED)_RED/RG format,
try uncompressed formats.  We were already doing this for the RGB(A) formats.

Fixes piglit arb_texture_compression-internal-format-query test.

NOTE: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 75f37ddba7)
2012-07-06 10:08:57 -07:00
Stéphane Marchesin
c60a83adc2 i915g: Don't avoid flushing when we have a pending fence.
Otherwise the fence will never arrive.
Also check for a NULL i915->batch.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 32b07bb149)
2012-07-06 10:08:56 -07:00
Stéphane Marchesin
db555c5d59 i915g: Don't invert signalled/unsignalled fences
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 2b4afdba05)
2012-07-06 10:08:56 -07:00
Brian Paul
f1423b1c20 svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0
The legal range for the device is apparently [-16.0, +15.0].
Limiting the range to [-15, +15] fixes piglit's lodbias test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a9eda41539)
2012-07-06 10:08:56 -07:00
Brian Paul
21d77c51c1 svga: fix min/max lod clamping
The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky.  Changing the base level
didn't work as expected before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit fd890873b2)
2012-07-06 10:08:56 -07:00
Brian Paul
fc7d43ee9a svga: add 0.5 in float->int conversion of sample min/max lod
This makes lod clamping more consistent with other drivers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5abcd198b8)
2012-07-06 10:08:56 -07:00
Brian Paul
ed8fcc0c82 st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 84c7c14697)
2012-07-06 10:08:56 -07:00
Ian Romanick
ed1da7e503 glsl: Fix pi/2 constant in acos built-in function
In single precision, 1.5707963 becomes 1.5707962513 which is too
small.  However, 1.5707964 becomes 1.5707963705 which is just right.
The value 1.5707964 is already used in asin.ir.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 4bfdc83135)

Conflicts:

	src/glsl/builtins/ir/acos.ir
2012-07-06 10:03:54 -07:00
Antoine Labour
74f21adbb7 mesa: Free uniforms correclty.
This is an array of uniforms, not a single one.

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

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit e2e9b4b10f)
2012-07-06 10:01:50 -07:00
Antoine Labour
09c746f2dc meta: Cleanup the resources we allocate.
When we have multiple shared contexts, and one of them is
long-running, this will lead to never freeing those resources
since they are shared. Instead, free them right away on context
destruction since we know the other context isn't using them.

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

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 53feb8ecdc)
2012-07-06 10:01:33 -07:00
Stéphane Marchesin
ab33bc8c7b glx: Handle a null reply in QueryVersion.
Works around crashes when X connections break.

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

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 0256edd709)
2012-07-06 10:00:46 -07:00
Kenneth Graunke
1edeb2cec1 glsl: Hook up loop_variable_state destructor to plug a memory leak.
While ~loop_state() is already freeing the loop_variable_state objects
via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor
was never getting called, so the hash table inside loop_variable_state
was never getting destroyed.

Fixes a memory leak in any shader with loops.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3603fdcebf)
2012-07-06 10:00:30 -07:00
Kenneth Graunke
afaf5b59e4 i965/fs: Fix user-defined FS outputs with less than four components.
OpenGL allows you to declare user-defined fragment shader outputs with
less than four components:

    out ivec2 color;

This makes sense if you're rendering to an RG format render target.

Previously, we assumed that all color outputs had four components (like
the built-in gl_FragColor/gl_FragData variables).  This caused us to
call emit_color_write for invalid indices, incrementing the output
virtual GRF's reg_offset beyond the size of the register.

This caused cascading failures: split_virtual_grfs would allocate new
size-1 registers based on the virtual GRF size, but then proceed to
rewrite the out-of-bounds accesses assuming that it had allocated enough
new (contiguously numbered) registers.  This resulted in instructions
that accessed size-1 GRFs which register numbers beyond
virtual_grf_next (i.e. registers that were never allocated).

Finally, this manifested as live variable analysis and instruction
scheduling accessing their temporary array with an out of bounds index
(as they're all sized based on virtual_grf_next), and the program would
segfault.

It looks like the hardware's Render Target Write message requires you to
send four components, even for RT formats such as RG or RGB.  This patch
continues to use all four MRFs, but doesn't bother to fill any data for
the last few, which should be unused.

+2 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2f18698220)

Conflicts:

	src/mesa/drivers/dri/i965/brw_fs.h

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-06 09:59:36 -07:00
Kenneth Graunke
1fc9b5a213 i965/vs: Fix texelFetchOffset() on pre-Gen7.
Commit 4650aea7a5 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

NOTE: This and 4650aea7a5 are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit cb18472eca)
2012-07-06 09:57:14 -07:00
Eric Anholt
9b38691927 i965/vs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
(cherry picked from commit 4650aea7a5)
2012-07-06 09:57:07 -07:00
Kenneth Graunke
6f1218385a i965/fs: Fix texelFetchOffset() on pre-Gen7.
Commit f41ecade7b fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

NOTE: This and f41ecade7b are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 217b62bf00)
2012-07-06 09:54:09 -07:00
Kenneth Graunke
5c2f9828e0 meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().
This isn't saved/restored by _mesa_meta_begin, so we need to do it
manually (like we do for the read/draw framebuffers).  Additionally,
we neglected to re-bind before the glRenderbufferStorage call.

+13 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7fde071f04)
2012-07-06 09:53:48 -07:00
Kenneth Graunke
a03d5e6a88 mesa: Unbind ARB_transform_feedback2 binding points on Delete too.
DeleteBuffer needs to unbind from these binding points as well, based on
the same rationale as the previous patch.

+51 oglconforms (together with the last patch).

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3edd2ba22b)
2012-07-06 09:53:15 -07:00
Kenneth Graunke
5fde348eb8 mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.

Now you can unbind your buffers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 05b086ce93)
2012-07-06 09:52:30 -07:00
Kenneth Graunke
a8fed44e9e mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
According to the GL 3.1 spec, section 2.9 ("Buffer Objects"):
"If a buffer object is deleted while it is bound, all bindings to that
 object in the current context (i.e. in the thread that called
 DeleteBuffers) are reset to zero."

The code already checked for a number of cases, but neglected these
newer binding points.

+21 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cb8ed93dd0)
2012-07-06 09:51:26 -07:00
Kenneth Graunke
0f7dffae69 glsl/builtins: Fix textureGrad() for Array samplers.
We were incorrectly assuming that the coordinate's dimensionality is
equal to the gradient's dimensionality.  For array types, the coordinate
has one more component.

Fixes 12 subcases of oglconform's glsl-bif-tex-grad test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 25edfbfccf)
2012-07-06 09:50:54 -07:00
Kenneth Graunke
7a34e98b61 mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE,
TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on
glPopAttrib(GL_TEXTURE_BIT).

Makes a number of oglconform tests happier.

v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture
    extensions, as suggested by Brian.  I'm not sure that any
    implementations still remain that don't support those, but why not?

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 608c3d2083)
2012-07-06 09:50:05 -07:00
Ian Romanick
39a0b79c6f glsl: Remove spurious printf messages
These look like debug messages from the switch-statement development.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit adfe531841)
2012-07-06 09:49:24 -07:00
Kenneth Graunke
5c8f5e9af0 ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.
If an object is allocated out of the NULL context, info->parent will be
NULL.  Using the PTR_FROM_HEADER macro would be incorrect: it would say
that ralloc_parent(ralloc_context(NULL)) == sizeof(ralloc_header).

Fixes the new "null_parent" unit test.

NOTE: This is a candidate for the 7.9, 7.10, 7.11, and 8.0 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1559b2e2d7)
2012-07-06 09:49:05 -07:00
Kurt Roeckx
a72fdfed7b i830: Fix crash for GL_STENCIL_TEST in i830Enable()
commit 87f12bb2d9 tried to fix rb->mt
being NULL, but change this case wrong.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f92b2e5e90)
2012-07-06 09:48:11 -07:00
Lukas Rössler
ba45b6deea glu: fix two Clang warnings
This patch removes two Clang warnings in GLU:

The first one seems to be an actual bug in mapdesc.cc: Clang complains
that sizeof(dest) will return the size of REAL*[MAXCOORDS], instead of
the intended REAL[MAXCOORDS][MAXCOORDS]. The second one is just
cosmetic because Clang doesn't like extra parentheses.

NOTE: This is a candidate for the 8.0 branch

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6178b653c7)
2012-07-06 09:47:42 -07:00
Dylan Noblesmith
04c35a5dff mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0
As noted in commit be4e46b21a,
this was missing before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8e90913e9f)
2012-07-06 09:46:03 -07:00
Kenneth Graunke
3bcddd5e89 glsl: Remove unused ir_loop_jump::loop pointer.
Commit 0c005bd7 intended to make ir_loop_jump::mode public, but also
accidentally added a new pointer to the enclosing loop.  Furthermore, it
tried to initialize the new field by adding "this->loop = loop;" to the
constructor, but since there is no loop parameter, this only initialized
the field to itself---so it will likely be a garbage pointer.

A lot of code, such as lower_jumps, allocates new loop jumps without
setting this field appropriately, so any uses would probably just crash.

Thankfully, there were none, so we can just delete the field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51574
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b1802a2115)
2012-07-03 15:32:16 -07:00
Ian Romanick
313d48a110 glx/tests: Fix off-by-one error in allocating extension string buffer
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
(cherry picked from commit 5fb178ee43)
2012-07-03 12:39:22 -07:00
Brian Paul
076805c9c2 mesa: fix missing return value in getteximage_error_check() 2012-07-03 10:48:33 -06:00
Brian Paul
d715d3f4a8 mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
in _mesa_error_check_format_and_type().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967
(cherry picked from commit df1cd55ebf)
2012-06-20 12:51:28 -07:00
Brian Paul
af47c324aa mesa: new _mesa_error_check_format_and_type() function
This replaces the _mesa_is_legal_format_and_type() function.

According to the spec, some invalid format/type combinations to
glDrawPixels, ReadPixels and glTexImage should generate
GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION.

With the old function we didn't make that distinction and generated
GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION.  The new
function returns one of those errors or GL_NO_ERROR.

This will also let us remove some redundant format/type checks in
follow-on commit.

v2: add more checks for ARB_texture_rgb10_a2ui at the top of
_mesa_error_check_format_and_type() per Ian.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 627b435dfe)
2012-06-20 12:51:28 -07:00
Marek Olšák
1af70e475f mesa: allow exposing GL3 without EXT_texture_integer
Strictly speaking, it's not legal to expose EXT_texture_integer without
EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4
is available without checking for it).

The check in compute_version is removed as well, because that's already
covered by GLSLVersion >= 130.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3363e87d7d)
2012-06-20 12:51:28 -07:00
Kenneth Graunke
1f4f86e951 i965: Fix brw_swap_cmod() for LE/GE comparisons.
The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want
to simply exchange arguments, not negate the condition.  If equality was
part of the original comparison, it should remain part of the swapped
version.

This is the true cause of bug #50298.  It didn't manifest itself on
Sandybridge because we embed the conditional modifier in the IF
instruction rather than emitting a CMP.  All other platforms use CMP.

It also didn't manifest itself on the master branch because commit
be5f27a84d ("glsl: Refine the loop instruction counting.") papered over
the problem.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5b83bdc154)
2012-06-18 15:51:40 -07:00
Brian Paul
6dd1270008 svga: fix synchronization bug between sampler views and surfaces
This fixes a bug where a sampler view was using stale texture/resource
data when the texture was modified through a surface (render to texture).
Bumping the texture and layer ages triggers sampler view revalidation.

Fixes piglit fbo-blit failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8ae93c68ea)
2012-06-18 13:26:07 -06:00
Brian Paul
29c67f9203 st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output
When drawing a depth image the fragment shader also needs to emit the
current raster color.

The new piglit drawpix-z test exercises this.

NOTE: This is a candiate for the 8.0 branch.
(cherry picked from commit f677954e07)
2012-06-18 13:24:23 -06:00
Brian Paul
29c4e92b2c draw: fix primitive restart bug by using the index buffer offset
The code which scans the index buffer for restart indexes wasn't adding
the index buffer offset so we were always starting at offset=0.  The
offset is usually zero so it wasn't noticed before.

Fixes a failure in the piglit primitive-restart test when testing
vertex data + index data in a single VBO.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 1609efb418)
2012-06-18 10:33:38 -06:00
Vadim Girlin
26f7f8076d st/mesa: set stObj->lastLevel in guess_and_alloc_texture
Fixes lockups/asserts with depthstencil-render-miplevels tests and r600g.
Should also fix https://bugs.freedesktop.org/show_bug.cgi?id=50033

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c91b4edff9)
2012-06-18 10:33:37 -06:00
Brian Paul
dc8134fe98 mesa: fix Z32_FLOAT -> uint conversion functions
The IROUND converted all arguments to 0 or 1.  That's not what we wanted.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 31d59c78f0)
2012-06-18 10:33:37 -06:00
Andreas Betz
a211a140a6 vega: fix 565 color unpacking bug
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9d6e908f14)
2012-06-18 10:33:37 -06:00
José Fonseca
7fd94900e0 mesa: Avoid void * arithmetic.
Should fix MSVC build.
(cherry picked from commit 3409118371)
2012-06-18 10:33:37 -06:00
Christoph Bumiller
e902faa18a nv50: handle NEG,ABS modifiers for short RCP encoding 2012-06-14 23:12:20 +02:00
Kenneth Graunke
cb70af5c94 mesa: Check for a negative "size" parameter in glCopyBufferSubData().
From the GL_ARB_copy_buffer spec:
"An INVALID_VALUE error is generated if any of readoffset, writeoffset,
 or size are negative [...]"

Fixes oglconform's copybuffer/negative.CNNegativeValues test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit a75e704326)
2012-06-11 13:38:19 -07:00
Brian Paul
3d657b14b4 docs: add link to 8.0.3 release notes 2012-05-21 09:26:39 -06:00
Paul Seidler
84e74ca275 tests: include mesa headers
else they will fail for fresh installs

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:42:52 -06:00
Ian Romanick
44f550ef90 docs: Add 8.0.3 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-18 16:17:01 -07:00
140 changed files with 1928 additions and 509 deletions

View File

@@ -184,7 +184,7 @@ ultrix-gcc:
# Rules for making release tarballs
PACKAGE_VERSION=8.0.3
PACKAGE_VERSION=8.0.5
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)

29
bin/get-pick-list.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
# Script for generating a list of candidates for cherry-picking to a stable branch
# Grep for commits with "cherry picked from commit" in the commit message.
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
grep "cherry picked from commit" |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
if [ -f .git/cherry-ignore ] ; then
if grep -q ^$sha .git/cherry-ignore ; then
continue
fi
fi
# Check to see if it has already been picked over.
if grep -q ^$sha already_picked ; then
continue
fi
git log -n1 --pretty=oneline $sha | cat
done
rm -f already_picked

23
bin/shortlog_mesa.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
typeset -i in_log=0
git shortlog $* | while read l
do
if [ $in_log -eq 0 ]; then
echo '<p>'$l'</p>'
echo '<ul>'
in_log=1
elif echo "$l" | egrep -q '^$' ; then
echo '</ul>'
echo
in_log=0
else
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
echo ' <li>'${mesg}'</li>'
fi
done

View File

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

View File

@@ -28,7 +28,9 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
TBD.
b7210a6d6e4584bd852ab29294ce717e MesaLib-8.0.3.tar.gz
cc5ee15e306b8c15da6a478923797171 MesaLib-8.0.3.tar.bz2
32773634a0f7e70a680505a81426eccf MesaLib-8.0.3.zip
</pre>
<h2>New features</h2>

201
docs/relnotes-8.0.4.html Normal file
View File

@@ -0,0 +1,201 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 8.0.4 Release Notes / July 10, 2012</h1>
<p>
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
</p>
<p>
Mesa 8.0.4 implements the OpenGL 3.0 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 3.0.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
02b96082d2f1ad72e7385f4022afafb9 MesaLib-8.0.4.tar.gz
d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2
1f0fdabe6e8019d4de6c16e20e74d163 MesaLib-8.0.4.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length &lt;= buffer-&gt;width0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb-&gt;rtt_level &lt;= strb-&gt;texture-&gt;last_level' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-8.0.3..mesa-8.0.4
</pre>
<p>Andreas Betz (1):</p>
<ul>
<li>vega: fix 565 color unpacking bug</li>
</ul>
<p>Antoine Labour (2):</p>
<ul>
<li>meta: Cleanup the resources we allocate.</li>
<li>mesa: Free uniforms correclty.</li>
</ul>
<p>Brian Paul (22):</p>
<ul>
<li>docs: add link to 8.0.3 release notes</li>
<li>mesa: fix Z32_FLOAT -&gt; uint conversion functions</li>
<li>draw: fix primitive restart bug by using the index buffer offset</li>
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
<li>svga: fix synchronization bug between sampler views and surfaces</li>
<li>mesa: new _mesa_error_check_format_and_type() function</li>
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
<li>mesa: fix missing return value in getteximage_error_check()</li>
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
<li>svga: add 0.5 in float-&gt;int conversion of sample min/max lod</li>
<li>svga: fix min/max lod clamping</li>
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
<li>draw: fix missing immediates bug in polygon stipple code</li>
<li>st/mesa: fix max_offset computation for base vertex</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
</ul>
<p>Dylan Noblesmith (1):</p>
<ul>
<li>mesa: require GL_MAX_SAMPLES &gt;= 4 for GL 3.0</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/vs: Fix texelFetchOffset()</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>docs: Add 8.0.3 release md5sums</li>
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
<li>glsl: Remove spurious printf messages</li>
<li>glsl: Fix pi/2 constant in acos built-in function</li>
<li>mesa: Bump version number to 8.0.4</li>
</ul>
<p>José Fonseca (2):</p>
<ul>
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
</ul>
<p>Kenneth Graunke (15):</p>
<ul>
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
</ul>
<p>Kurt Roeckx (1):</p>
<ul>
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
</ul>
<p>Lukas Rössler (1):</p>
<ul>
<li>glu: fix two Clang warnings</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
<li>st/mesa: don't do srgb-&gt;linear conversion in decompress_with_blit</li>
</ul>
<p>Paul Seidler (1):</p>
<ul>
<li>tests: include mesa headers</li>
</ul>
<p>Stéphane Marchesin (3):</p>
<ul>
<li>glx: Handle a null reply in QueryVersion.</li>
<li>i915g: Don't invert signalled/unsignalled fences</li>
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
</ul>
<p>Thomas Gstädtner (1):</p>
<ul>
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
</ul>
<p>Vadim Girlin (2):</p>
<ul>
<li>st/mesa: set stObj-&gt;lastLevel in guess_and_alloc_texture</li>
<li>r600g: check gpr count limit</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
</ul>
</body>
</html>

252
docs/relnotes-8.0.5.html Normal file
View File

@@ -0,0 +1,252 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 8.0.5 Release Notes / October 24, 2012</h1>
<p>
Mesa 8.0.5 is a bug fix release which fixes bugs found since the 8.0.4 release.
</p>
<p>
Mesa 8.0.5 implements the OpenGL 3.0 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 3.0.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
TBD
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44912">Bug 44912</a> - [bisected] WebGL conformance/textures/texture-mips tests fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46644">Bug 46644</a> - Sandybridge Mobile: ARBfp TXP with coords from fragment.color doesn't apply W divide</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46784">Bug 46784</a> - MAD using multiply written register fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47375">Bug 47375</a> - Blender crash on startup after upgrade to mesa 8.0.1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48120">Bug 48120</a> - GL_EXT_texture_sRGB_decode still broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48628">Bug 48628</a> - [bisected ILK]Oglc fogexp(basic.allCases) regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=49772">Bug 49772</a> - [SNB]Oglc depth-stencil(basic.read.ds) regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52129">Bug 52129</a> - [Bisected ILK]Piglit spec_ARB_shader_texture_lod_execution_glsl-fs-shadow2DGradARB-01 regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52382">Bug 52382</a> - [ivb gt1] Severe image corruption and GPU Hang, too many PS threads</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52563">Bug 52563</a> - build failure - struct radeon_renderbuffer has no member named Base</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53311">Bug 53311</a> - [Bisected IVB]Oglc transform_feedback(advanced.transformFeedback.points) Invalid argument</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53314">Bug 53314</a> - [llvmpipe] src/gallium/drivers/llvmpipe/lp_texture.c:920:llvmpipe_get_texture_tile_layout: Assertion `x &lt; lpr-&gt;tiles_per_row[level]' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53316">Bug 53316</a> - [llvmpipe] src/gallium/drivers/llvmpipe/lp_texture.c:601:llvmpipe_get_transfer: Assertion `resource' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53317">Bug 53317</a> - [llvmpipe] SIGSEGV src/gallium/auxiliary/gallivm/lp_bld_sample.c:99</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53318">Bug 53318</a> - [softpipe] sp_state_shader.c:194:softpipe_delete_fs_state: Assertion `var != softpipe-&gt;fs_variant' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53319">Bug 53319</a> - [softpipe] sp_texture.c:322:softpipe_get_transfer: Assertion `level &lt;= resource-&gt;last_level' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53618">Bug 53618</a> - [Bisected i915]Piglit glx_GLX_ARB_create_context_NULL_attribute_list Aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54183">Bug 54183</a> - [Bisected ILK regression]many piglit/oglc/ogles2 cases Segmentation fault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54193">Bug 54193</a> - output_components uninitialized in fs_visitor::emit_fb_writes()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54301">Bug 54301</a> - [Bisected ILK regression]Piglit glx_GLX_ARB_create_context_forward-compatible_flag_with_3.0 Segmentation fault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56211">Bug 56211</a> - src/mesa/state_tracker/st_cb_texture.c:1123:copy_image_data_to_texture: Assertion `u_minify(stImage-&gt;pt-&gt;height0, src_level) == stImage-&gt;base.Height' failed.</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-8.0.4..mesa-8.0.5
</pre>
<p>Alex Deucher (3):</p>
<ul>
<li>r600g: 8.0.x support for Trinity</li>
<li>r600g: add new Sumo, Palm, BTC pci ids</li>
<li>r600g: add additional evergreen pci ids</li>
</ul>
<p>Andreas Boll (4):</p>
<ul>
<li>docs/relnotes-8.0.4: fix html markup</li>
<li>mesa: fix html in shortlog_mesa.sh script</li>
<li>mesa: add get-pick-list.sh script into bin/</li>
<li>mesa: Bump version number to 8.0.5</li>
</ul>
<p>Brian Paul (18):</p>
<ul>
<li>mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions</li>
<li>intel: use _mesa_is_winsys/user_fbo() helpers</li>
<li>st/egl: fix uninitialized pointer bug</li>
<li>mesa: added Ian's shortlog_mesa.sh script in bin/</li>
<li>mesa: loosen small matrix determinant check</li>
<li>xlib: add X error handler around XGetImage() call</li>
<li>radeon: set swrast_renderbuffer::ColorType field when mapping renderbuffers</li>
<li>svga: fix invalid memory reference in needs_to_create_zero()</li>
<li>meta: fix glDrawPixels fallback test, stencil drawing</li>
<li>radeon: fix Base/base typo</li>
<li>st/mesa: fix glCopyTexSubImage crash</li>
<li>gallivm: fix crash in lp_sampler_static_state()</li>
<li>st/mesa: fix renderbuffer validation bug</li>
<li>softpipe: fix softpipe_delete_fs_state() failed assertion</li>
<li>mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image</li>
<li>st/mesa: s/CALLOC/calloc/ to fix allocation bug</li>
<li>mesa: do internal format error checking for glTexStorage()</li>
<li>mesa: fix incorrect error for glCompressedSubTexImage</li>
</ul>
<p>Chad Versace (3):</p>
<ul>
<li>mesa: Don't advertise GLES extensions in GL contexts</li>
<li>i830: Fix stack corruption</li>
<li>swrast: Fix implicit declaration warnings</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>mesa: fix dropped &amp;&amp; in glGetStringi()</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, too</li>
</ul>
<p>Eric Anholt (9):</p>
<ul>
<li>i965/gen7: Reduce GT1 WM thread count according to updated BSpec.</li>
<li>i965/fs: Invalidate live intervals in passes that remove an instruction.</li>
<li>i965: Fix bug in the old FS backend's projtex() calculation.</li>
<li>i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.</li>
<li>i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.</li>
<li>i965: Fix accumulator_contains() test to also reject swizzles of the dst.</li>
<li>mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.</li>
<li>mesa: In conditional rendering fallback, check the query status.</li>
<li>i965: Drop the confusing saturate argument to math instruction setup.</li>
</ul>
<p>Ian Romanick (8):</p>
<ul>
<li>docs: Add 8.0.4 release md5sums</li>
<li>Revert "i965: Avoid unnecessary recompiles for shaders that don't use dFdy()."</li>
<li>i965: Fix regression in depth texture rendering on pre-SNB</li>
<li>dri2: Fix bug in attribute handling for non-desktop OpenGL contexts</li>
<li>mesa: Generate an error when glCopyTexImage border is invalid</li>
<li>mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper</li>
<li>mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT</li>
<li>dri_util: Use calloc to allocate __DRIcontext</li>
</ul>
<p>Jonas Maebe (1):</p>
<ul>
<li>darwin: do not create double-buffered offscreen pixel formats</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>intel: move error on create context to proper path</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa: disable MSVC global optimization in pack.c</li>
</ul>
<p>Kenneth Graunke (8):</p>
<ul>
<li>mesa: Use GLdouble for depthMax in final unpack conversions.</li>
<li>i965/fs: Initialize output_components[] by filling it with zeros.</li>
<li>mesa: Prevent repeated glDeleteShader() from blowing away our refcounts.</li>
<li>i965: Support MESA_FORMAT_SIGNED_RGBA_16.</li>
<li>glsl: Fix #pragma invariant(all) language version check.</li>
<li>i965/vs: Don't clobber sampler message MRFs with subexpressions.</li>
<li>intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.</li>
<li>i965/fs: Don't use brw-&gt;fragment_program in calculate_urb_setup().</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>winsys/radeon: Remove unnecessary pipe_thread_destroy in radeon_drm_cs_destroy</li>
</ul>
<p>Marek Olšák (6):</p>
<ul>
<li>mesa: remove assertions that do not allow compressed 2D_ARRAY textures</li>
<li>r300g: fix colormask with non-BGRA formats</li>
<li>r600g: fix RSQ of negative value on Cayman</li>
<li>r600g: fix EXP on Cayman</li>
<li>r600g: fix instance divisor on Cayman</li>
<li>gallium/u_blit: set dst format from pipe_resource, not pipe_surface</li>
</ul>
<p>Michel Dänzer (2):</p>
<ul>
<li>st/mesa: Fix source miptree level for copying data to finalized miptree.</li>
<li>st/mesa: Fix assertions for copying texture image to finalized miptree.</li>
</ul>
<p>Niels Ole Salscheider (1):</p>
<ul>
<li>st/mesa: index can be negative in the PROGRAM_CONSTANT case</li>
</ul>
<p>Paul Berry (5):</p>
<ul>
<li>i965: Compute dFdy() correctly for FBOs.</li>
<li>mesa: Add UsesDFdy to struct gl_fragment_program.</li>
<li>i965: Avoid unnecessary recompiles for shaders that don't use dFdy().</li>
<li>i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.</li>
<li>i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.</li>
</ul>
<p>Stéphane Marchesin (1):</p>
<ul>
<li>glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field</li>
</ul>
<p>Tapani Pälli (2):</p>
<ul>
<li>xmlconfig: use __progname when building for Android</li>
<li>android: do not expose single buffered eglconfigs</li>
</ul>
<p>Vadim Girlin (1):</p>
<ul>
<li>winsys/radeon: fix relocs caching</li>
</ul>
</body>
</html>

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-8.0.4.html">8.0.4 release notes</A>
<LI><A HREF="relnotes-8.0.3.html">8.0.3 release notes</A>
<LI><A HREF="relnotes-8.0.2.html">8.0.2 release notes</A>
<LI><A HREF="relnotes-8.0.1.html">8.0.1 release notes</A>
<LI><A HREF="relnotes-8.0.html">8.0 release notes</A>

View File

@@ -157,6 +157,7 @@ CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
CHIPSET(0x68C7, REDWOOD_68C7, REDWOOD)
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
@@ -179,6 +180,8 @@ CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
CHIPSET(0x688C, CYPRESS_688C, CYPRESS)
CHIPSET(0x688D, CYPRESS_688D, CYPRESS)
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)
@@ -195,6 +198,7 @@ CHIPSET(0x9806, PALM_9806, PALM)
CHIPSET(0x9807, PALM_9807, PALM)
CHIPSET(0x9808, PALM_9808, PALM)
CHIPSET(0x9809, PALM_9809, PALM)
CHIPSET(0x980A, PALM_980A, PALM)
CHIPSET(0x9640, SUMO_9640, SUMO)
CHIPSET(0x9641, SUMO_9641, SUMO)
@@ -204,6 +208,7 @@ CHIPSET(0x9644, SUMO2_9644, SUMO2)
CHIPSET(0x9645, SUMO2_9645, SUMO2)
CHIPSET(0x9647, SUMO_9647, SUMO)
CHIPSET(0x9648, SUMO_9648, SUMO)
CHIPSET(0x9649, SUMO_9649, SUMO)
CHIPSET(0x964a, SUMO_964A, SUMO)
CHIPSET(0x964b, SUMO_964B, SUMO)
CHIPSET(0x964c, SUMO_964C, SUMO)
@@ -239,6 +244,7 @@ CHIPSET(0x6729, BARTS_6729, BARTS)
CHIPSET(0x6738, BARTS_6738, BARTS)
CHIPSET(0x6739, BARTS_6739, BARTS)
CHIPSET(0x673E, BARTS_673E, BARTS)
CHIPSET(0x6740, TURKS_6740, TURKS)
CHIPSET(0x6741, TURKS_6741, TURKS)
CHIPSET(0x6742, TURKS_6742, TURKS)
@@ -249,6 +255,7 @@ CHIPSET(0x6746, TURKS_6746, TURKS)
CHIPSET(0x6747, TURKS_6747, TURKS)
CHIPSET(0x6748, TURKS_6748, TURKS)
CHIPSET(0x6749, TURKS_6749, TURKS)
CHIPSET(0x674A, TURKS_674A, TURKS)
CHIPSET(0x6750, TURKS_6750, TURKS)
CHIPSET(0x6751, TURKS_6751, TURKS)
CHIPSET(0x6758, TURKS_6758, TURKS)
@@ -275,7 +282,33 @@ CHIPSET(0x6766, CAICOS_6766, CAICOS)
CHIPSET(0x6767, CAICOS_6767, CAICOS)
CHIPSET(0x6768, CAICOS_6768, CAICOS)
CHIPSET(0x6770, CAICOS_6770, CAICOS)
CHIPSET(0x6771, CAICOS_6771, CAICOS)
CHIPSET(0x6772, CAICOS_6772, CAICOS)
CHIPSET(0x6778, CAICOS_6778, CAICOS)
CHIPSET(0x6779, CAICOS_6779, CAICOS)
CHIPSET(0x677B, CAICOS_677B, CAICOS)
CHIPSET(0x9900, ARUBA_9900, ARUBA)
CHIPSET(0x9901, ARUBA_9901, ARUBA)
CHIPSET(0x9903, ARUBA_9903, ARUBA)
CHIPSET(0x9904, ARUBA_9904, ARUBA)
CHIPSET(0x9905, ARUBA_9905, ARUBA)
CHIPSET(0x9906, ARUBA_9906, ARUBA)
CHIPSET(0x9907, ARUBA_9907, ARUBA)
CHIPSET(0x9908, ARUBA_9908, ARUBA)
CHIPSET(0x9909, ARUBA_9909, ARUBA)
CHIPSET(0x990A, ARUBA_990A, ARUBA)
CHIPSET(0x990F, ARUBA_990F, ARUBA)
CHIPSET(0x9910, ARUBA_9910, ARUBA)
CHIPSET(0x9913, ARUBA_9913, ARUBA)
CHIPSET(0x9917, ARUBA_9917, ARUBA)
CHIPSET(0x9918, ARUBA_9918, ARUBA)
CHIPSET(0x9919, ARUBA_9919, ARUBA)
CHIPSET(0x9990, ARUBA_9990, ARUBA)
CHIPSET(0x9991, ARUBA_9991, ARUBA)
CHIPSET(0x9992, ARUBA_9992, ARUBA)
CHIPSET(0x9993, ARUBA_9993, ARUBA)
CHIPSET(0x9994, ARUBA_9994, ARUBA)
CHIPSET(0x99A0, ARUBA_99A0, ARUBA)
CHIPSET(0x99A2, ARUBA_99A2, ARUBA)
CHIPSET(0x99A4, ARUBA_99A4, ARUBA)

View File

@@ -498,6 +498,14 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
struct dri2_egl_config *dri2_conf;
unsigned int double_buffered = 0;
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_DOUBLE_BUFFER, &double_buffered);
/* support only double buffered configs */
if (!double_buffered)
continue;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
count + 1, visuals[i].size, surface_type, NULL,
@@ -523,17 +531,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
/* there is no front buffer so no OpenGL */
dri2_conf->base.RenderableType &= ~EGL_OPENGL_BIT;
dri2_conf->base.Conformant &= ~EGL_OPENGL_BIT;
/*
* We want to make sure GL_DRAW_BUFFER for windows or pbuffers is always
* GL_BACK. For EGL configs that do not have a double DRI config, clear
* the surface type.
*
* This is just to be on the safe side. dri2_add_config never sets
* EGL_WINDOW_BIT or EGL_PBUFFER_BIT for such configs.
*/
if (!dri2_conf->dri_double_config)
dri2_conf->base.SurfaceType = 0;
}
return (count != 0);

View File

@@ -65,8 +65,13 @@ static void
draw_llvm_garbage_collect_callback(void *cb_data)
{
struct draw_llvm *llvm = (struct draw_llvm *) cb_data;
struct draw_context *draw = llvm->draw;
struct draw_llvm_variant_list_item *li;
/* Ensure prepare will be run and shaders recompiled */
assert(!draw->suspend_flushing);
draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);
/* free all shader variants */
li = first_elem(&llvm->vs_variants_list);
while (!at_end(&llvm->vs_variants_list, li)) {

View File

@@ -165,11 +165,16 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
}
/**
* TGSI immediate declaration transform callback.
* We're just counting the number of immediates here.
*/
static void
pstip_transform_immed(struct tgsi_transform_context *ctx,
struct tgsi_full_immediate *immed)
{
struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx;
ctx->emit_immediate(ctx, immed); /* emit to output shader */
pctx->numImmed++;
}

View File

@@ -329,25 +329,28 @@ draw_pt_arrays_restart(struct draw_context *draw,
if (draw->pt.user.elts) {
/* indexed prims (draw_elements) */
const char *elts =
(const char *) draw->pt.user.elts + draw->pt.index_buffer.offset;
cur_start = start;
cur_count = 0;
switch (draw->pt.user.eltSize) {
case 1:
{
const ubyte *elt_ub = (const ubyte *) draw->pt.user.elts;
const ubyte *elt_ub = (const ubyte *) elts;
PRIM_RESTART_LOOP(elt_ub);
}
break;
case 2:
{
const ushort *elt_us = (const ushort *) draw->pt.user.elts;
const ushort *elt_us = (const ushort *) elts;
PRIM_RESTART_LOOP(elt_us);
}
break;
case 4:
{
const uint *elt_ui = (const uint *) draw->pt.user.elts;
const uint *elt_ui = (const uint *) elts;
PRIM_RESTART_LOOP(elt_ui);
}
break;

View File

@@ -99,15 +99,14 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
const struct pipe_sampler_view *view,
const struct pipe_sampler_state *sampler)
{
const struct pipe_resource *texture = view->texture;
const struct pipe_resource *texture;
memset(state, 0, sizeof *state);
if(!texture)
if (!sampler || !view || !view->texture)
return;
if(!sampler)
return;
texture = view->texture;
/*
* We don't copy sampler state over unless it is actually enabled, to avoid

View File

@@ -370,7 +370,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
dstX0, dstY0, dstX1, dstY1);
src_format = util_format_linear(src_tex->format);
dst_format = util_format_linear(dst->format);
dst_format = util_format_linear(dst->texture->format);
/*
* Check for simple case: no format conversion, no flipping, no stretching,

View File

@@ -45,7 +45,10 @@ static void i915_flush_pipe( struct pipe_context *pipe,
draw_flush(i915->draw);
if (i915->batch->map == i915->batch->ptr) {
/* Only shortcut this if we have no fence, otherwise we must flush the
* empty batchbuffer to get our fence back.
*/
if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
return;
}

View File

@@ -368,7 +368,7 @@ i915_fence_signalled(struct pipe_screen *screen,
{
struct i915_screen *is = i915_screen(screen);
return is->iws->fence_signalled(is->iws, fence) == 0;
return is->iws->fence_signalled(is->iws, fence) == 1;
}
static boolean
@@ -378,7 +378,7 @@ i915_fence_finish(struct pipe_screen *screen,
{
struct i915_screen *is = i915_screen(screen);
return is->iws->fence_finish(is->iws, fence) == 0;
return is->iws->fence_finish(is->iws, fence) == 1;
}

View File

@@ -865,8 +865,10 @@ emit_flop(struct nv_pc *pc, struct nv_instruction *i)
assert(SFILE(i, 0) == NV_FILE_GPR);
if (!i->is_long) {
assert(i->opcode == NV_OP_RCP);
emit_form_MUL(pc, i);
assert(i->opcode == NV_OP_RCP && !src0->mod);
if (src0->mod & NV_MOD_NEG) pc->emit[0] |= 0x00400000;
if (src0->mod & NV_MOD_ABS) pc->emit[0] |= 0x00008000;
return;
}

View File

@@ -42,6 +42,16 @@ struct r300_fragment_shader;
struct r300_vertex_shader;
struct r300_stencilref_context;
enum colormask_swizzle {
COLORMASK_BGRA,
COLORMASK_RGBA,
COLORMASK_RRRR,
COLORMASK_AAAA,
COLORMASK_GRRG,
COLORMASK_ARRA,
COLORMASK_NUM_SWIZZLES
};
struct r300_atom {
/* Name, for debugging. */
const char* name;
@@ -67,7 +77,7 @@ struct r300_aa_state {
struct r300_blend_state {
struct pipe_blend_state state;
uint32_t cb_clamp[8];
uint32_t cb_clamp[COLORMASK_NUM_SWIZZLES][8];
uint32_t cb_noclamp[8];
uint32_t cb_no_readwrite[8];
};
@@ -321,6 +331,8 @@ struct r300_surface {
/* Whether the CBZB clear is allowed on the surface. */
boolean cbzb_allowed;
unsigned colormask_swizzle;
};
struct r300_texture_desc {

View File

@@ -45,10 +45,12 @@ void r300_emit_blend_state(struct r300_context* r300,
CS_LOCALS(r300);
if (fb->nr_cbufs) {
if (fb->cbufs[0]->format == PIPE_FORMAT_R16G16B16A16_FLOAT)
if (fb->cbufs[0]->format == PIPE_FORMAT_R16G16B16A16_FLOAT) {
WRITE_CS_TABLE(blend->cb_noclamp, size);
else
WRITE_CS_TABLE(blend->cb_clamp, size);
} else {
unsigned swz = r300_surface(fb->cbufs[0])->colormask_swizzle;
WRITE_CS_TABLE(blend->cb_clamp[swz], size);
}
} else {
WRITE_CS_TABLE(blend->cb_no_readwrite, size);
}

View File

@@ -169,15 +169,52 @@ static boolean blend_discard_if_src_alpha_color_1(unsigned srcRGB, unsigned srcA
dstA == PIPE_BLENDFACTOR_ONE);
}
/* The hardware colormask is clunky a must be swizzled depending on the format.
* This was figured out by trial-and-error. */
static unsigned bgra_cmask(unsigned mask)
{
/* Gallium uses RGBA color ordering while R300 expects BGRA. */
return ((mask & PIPE_MASK_R) << 2) |
((mask & PIPE_MASK_B) >> 2) |
(mask & (PIPE_MASK_G | PIPE_MASK_A));
}
static unsigned rgba_cmask(unsigned mask)
{
return mask & PIPE_MASK_RGBA;
}
static unsigned rrrr_cmask(unsigned mask)
{
return (mask & PIPE_MASK_R) |
((mask & PIPE_MASK_R) << 1) |
((mask & PIPE_MASK_R) << 2) |
((mask & PIPE_MASK_R) << 3);
}
static unsigned aaaa_cmask(unsigned mask)
{
return ((mask & PIPE_MASK_A) >> 3) |
((mask & PIPE_MASK_A) >> 2) |
((mask & PIPE_MASK_A) >> 1) |
(mask & PIPE_MASK_A);
}
static unsigned grrg_cmask(unsigned mask)
{
return ((mask & PIPE_MASK_R) << 1) |
((mask & PIPE_MASK_R) << 2) |
((mask & PIPE_MASK_G) >> 1) |
((mask & PIPE_MASK_G) << 2);
}
static unsigned arra_cmask(unsigned mask)
{
return ((mask & PIPE_MASK_R) << 1) |
((mask & PIPE_MASK_R) << 2) |
((mask & PIPE_MASK_A) >> 3) |
(mask & PIPE_MASK_A);
}
/* Create a new blend state based on the CSO blend state.
*
* This encompasses alpha blending, logic/raster ops, and blend dithering. */
@@ -190,9 +227,9 @@ static void* r300_create_blend_state(struct pipe_context* pipe,
uint32_t blend_control_noclamp = 0; /* R300_RB3D_CBLEND: 0x4e04 */
uint32_t alpha_blend_control = 0; /* R300_RB3D_ABLEND: 0x4e08 */
uint32_t alpha_blend_control_noclamp = 0; /* R300_RB3D_ABLEND: 0x4e08 */
uint32_t color_channel_mask = 0; /* R300_RB3D_COLOR_CHANNEL_MASK: 0x4e0c */
uint32_t rop = 0; /* R300_RB3D_ROPCNTL: 0x4e18 */
uint32_t dither = 0; /* R300_RB3D_DITHER_CTL: 0x4e50 */
int i;
CB_LOCALS;
blend->state = *state;
@@ -331,20 +368,6 @@ static void* r300_create_blend_state(struct pipe_context* pipe,
(state->logicop_func) << R300_RB3D_ROPCNTL_ROP_SHIFT;
}
/* Color channel masks for all MRTs. */
color_channel_mask = bgra_cmask(state->rt[0].colormask);
if (r300screen->caps.is_r500 && state->independent_blend_enable) {
if (state->rt[1].blend_enable) {
color_channel_mask |= bgra_cmask(state->rt[1].colormask) << 4;
}
if (state->rt[2].blend_enable) {
color_channel_mask |= bgra_cmask(state->rt[2].colormask) << 8;
}
if (state->rt[3].blend_enable) {
color_channel_mask |= bgra_cmask(state->rt[3].colormask) << 12;
}
}
/* Neither fglrx nor classic r300 ever set this, regardless of dithering
* state. Since it's an optional implementation detail, we can leave it
* out and never dither.
@@ -358,14 +381,27 @@ static void* r300_create_blend_state(struct pipe_context* pipe,
*/
/* Build a command buffer. */
BEGIN_CB(blend->cb_clamp, 8);
OUT_CB_REG(R300_RB3D_ROPCNTL, rop);
OUT_CB_REG_SEQ(R300_RB3D_CBLEND, 3);
OUT_CB(blend_control);
OUT_CB(alpha_blend_control);
OUT_CB(color_channel_mask);
OUT_CB_REG(R300_RB3D_DITHER_CTL, dither);
END_CB;
{
unsigned (*func[COLORMASK_NUM_SWIZZLES])(unsigned) = {
bgra_cmask,
rgba_cmask,
rrrr_cmask,
aaaa_cmask,
grrg_cmask,
arra_cmask
};
for (i = 0; i < COLORMASK_NUM_SWIZZLES; i++) {
BEGIN_CB(blend->cb_clamp[i], 8);
OUT_CB_REG(R300_RB3D_ROPCNTL, rop);
OUT_CB_REG_SEQ(R300_RB3D_CBLEND, 3);
OUT_CB(blend_control);
OUT_CB(alpha_blend_control);
OUT_CB(func[i](state->rt[0].colormask));
OUT_CB_REG(R300_RB3D_DITHER_CTL, dither);
END_CB;
}
}
/* Build a command buffer. */
BEGIN_CB(blend->cb_noclamp, 8);
@@ -373,7 +409,7 @@ static void* r300_create_blend_state(struct pipe_context* pipe,
OUT_CB_REG_SEQ(R300_RB3D_CBLEND, 3);
OUT_CB(blend_control_noclamp);
OUT_CB(alpha_blend_control_noclamp);
OUT_CB(color_channel_mask);
OUT_CB(rgba_cmask(state->rt[0].colormask));
OUT_CB_REG(R300_RB3D_DITHER_CTL, dither);
END_CB;

View File

@@ -704,10 +704,87 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
}
}
static uint32_t r300_translate_colormask_swizzle(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_A8_UNORM:
case PIPE_FORMAT_A8_SNORM:
case PIPE_FORMAT_A16_UNORM:
case PIPE_FORMAT_A16_SNORM:
case PIPE_FORMAT_A16_FLOAT:
case PIPE_FORMAT_A32_FLOAT:
return COLORMASK_AAAA;
case PIPE_FORMAT_I8_UNORM:
case PIPE_FORMAT_I8_SNORM:
case PIPE_FORMAT_L8_UNORM:
case PIPE_FORMAT_L8_SNORM:
case PIPE_FORMAT_R8_UNORM:
case PIPE_FORMAT_R8_SNORM:
case PIPE_FORMAT_R32_FLOAT:
case PIPE_FORMAT_L32_FLOAT:
case PIPE_FORMAT_I32_FLOAT:
return COLORMASK_RRRR;
case PIPE_FORMAT_L8A8_SNORM:
case PIPE_FORMAT_L8A8_UNORM:
case PIPE_FORMAT_L16A16_UNORM:
case PIPE_FORMAT_L16A16_SNORM:
case PIPE_FORMAT_L16A16_FLOAT:
case PIPE_FORMAT_L32A32_FLOAT:
return COLORMASK_ARRA;
case PIPE_FORMAT_R8G8_SNORM:
case PIPE_FORMAT_R8G8_UNORM:
case PIPE_FORMAT_R16G16_UNORM:
case PIPE_FORMAT_R16G16_SNORM:
case PIPE_FORMAT_R16G16_FLOAT:
case PIPE_FORMAT_R32G32_FLOAT:
return COLORMASK_GRRG;
case PIPE_FORMAT_B5G6R5_UNORM:
case PIPE_FORMAT_B5G5R5A1_UNORM:
case PIPE_FORMAT_B5G5R5X1_UNORM:
case PIPE_FORMAT_B4G4R4A4_UNORM:
case PIPE_FORMAT_B4G4R4X4_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
/*case PIPE_FORMAT_B8G8R8A8_SNORM:*/
case PIPE_FORMAT_B8G8R8X8_UNORM:
/*case PIPE_FORMAT_B8G8R8X8_SNORM:*/
case PIPE_FORMAT_B10G10R10A2_UNORM:
return COLORMASK_BGRA;
case PIPE_FORMAT_R8G8B8X8_UNORM:
/*case PIPE_FORMAT_R8G8B8X8_SNORM:*/
case PIPE_FORMAT_R8G8B8A8_UNORM:
case PIPE_FORMAT_R8G8B8A8_SNORM:
case PIPE_FORMAT_R10G10B10A2_UNORM:
case PIPE_FORMAT_R10G10B10X2_SNORM:
case PIPE_FORMAT_R16_UNORM:
case PIPE_FORMAT_R16G16B16A16_UNORM:
case PIPE_FORMAT_R16_SNORM:
case PIPE_FORMAT_R16G16B16A16_SNORM:
case PIPE_FORMAT_R16_FLOAT:
case PIPE_FORMAT_R16G16B16A16_FLOAT:
case PIPE_FORMAT_R32G32B32A32_FLOAT:
case PIPE_FORMAT_L16_UNORM:
case PIPE_FORMAT_L16_SNORM:
case PIPE_FORMAT_L16_FLOAT:
case PIPE_FORMAT_I16_UNORM:
case PIPE_FORMAT_I16_SNORM:
case PIPE_FORMAT_I16_FLOAT:
return COLORMASK_RGBA;
default:
return ~0; /* Unsupported. */
}
}
boolean r300_is_colorbuffer_format_supported(enum pipe_format format)
{
return r300_translate_colorformat(format) != ~0 &&
r300_translate_out_fmt(format) != ~0;
r300_translate_out_fmt(format) != ~0 &&
r300_translate_colormask_swizzle(format) != ~0;
}
boolean r300_is_zs_format_supported(enum pipe_format format)
@@ -827,6 +904,8 @@ static void r300_texture_setup_fb_state(struct r300_surface *surf)
R300_COLOR_TILE(tex->tex.macrotile[level]) |
R300_COLOR_MICROTILE(tex->tex.microtile);
surf->format = r300_translate_out_fmt(surf->base.format);
surf->colormask_swizzle =
r300_translate_colormask_swizzle(surf->base.format);
}
}

View File

@@ -930,7 +930,7 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen)
}
/* add blocks */
if (ctx->screen->family == CHIP_CAYMAN)
if (ctx->screen->family >= CHIP_CAYMAN)
r = r600_context_add_block(ctx, cayman_config_reg_list,
Elements(cayman_config_reg_list), PKT3_SET_CONFIG_REG, EVERGREEN_CONFIG_REG_OFFSET);
else
@@ -938,7 +938,7 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen)
Elements(evergreen_config_reg_list), PKT3_SET_CONFIG_REG, EVERGREEN_CONFIG_REG_OFFSET);
if (r)
goto out_err;
if (ctx->screen->family == CHIP_CAYMAN)
if (ctx->screen->family >= CHIP_CAYMAN)
r = r600_context_add_block(ctx, cayman_context_reg_list,
Elements(cayman_context_reg_list), PKT3_SET_CONTEXT_REG, EVERGREEN_CONTEXT_REG_OFFSET);
else

View File

@@ -66,6 +66,7 @@ enum radeon_family {
CHIP_TURKS,
CHIP_CAICOS,
CHIP_CAYMAN,
CHIP_ARUBA,
CHIP_LAST,
};

View File

@@ -2689,7 +2689,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru
unsigned fetch_resource_start = rctx->chip_class >= EVERGREEN ? 0 : 160;
unsigned format, num_format, format_comp, endian;
u32 *bytecode;
int i, r;
int i, j, r;
/* Vertex element offsets need special handling. If the offset is
* bigger than what we can put in the fetch instruction we need to
@@ -2708,24 +2708,40 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru
for (i = 0; i < ve->count; i++) {
if (elements[i].instance_divisor > 1) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
alu.inst = BC_INST(&bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
alu.src[0].sel = 0;
alu.src[0].chan = 3;
alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
alu.src[1].value = (1ll << 32) / elements[i].instance_divisor + 1;
alu.dst.sel = i + 1;
alu.dst.chan = 3;
alu.dst.write = 1;
alu.last = 1;
if ((r = r600_bytecode_add_alu(&bc, &alu))) {
r600_bytecode_clear(&bc);
return r;
if (rctx->chip_class == CAYMAN) {
for (j = 0; j < 4; j++) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
alu.inst = BC_INST(&bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
alu.src[0].sel = 0;
alu.src[0].chan = 3;
alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
alu.src[1].value = (1ll << 32) / elements[i].instance_divisor + 1;
alu.dst.sel = i + 1;
alu.dst.chan = j;
alu.dst.write = j == 3;
alu.last = j == 3;
if ((r = r600_bytecode_add_alu(&bc, &alu))) {
r600_bytecode_clear(&bc);
return r;
}
}
} else {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
alu.inst = BC_INST(&bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
alu.src[0].sel = 0;
alu.src[0].chan = 3;
alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
alu.src[1].value = (1ll << 32) / elements[i].instance_divisor + 1;
alu.dst.sel = i + 1;
alu.dst.chan = 3;
alu.dst.write = 1;
alu.last = 1;
if ((r = r600_bytecode_add_alu(&bc, &alu))) {
r600_bytecode_clear(&bc);
return r;
}
}
}
}

View File

@@ -333,6 +333,7 @@ static const char *r600_get_family_name(enum radeon_family family)
case CHIP_TURKS: return "AMD TURKS";
case CHIP_CAICOS: return "AMD CAICOS";
case CHIP_CAYMAN: return "AMD CAYMAN";
case CHIP_ARUBA: return "AMD ARUBA";
default: return "AMD unknown";
}
}
@@ -777,7 +778,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
}
/* setup class */
if (rscreen->family == CHIP_CAYMAN) {
if (rscreen->family >= CHIP_CAYMAN) {
rscreen->chip_class = CAYMAN;
} else if (rscreen->family >= CHIP_CEDAR) {
rscreen->chip_class = EVERGREEN;

View File

@@ -1277,6 +1277,14 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
if (ctx.bc->chip_class == CAYMAN)
cm_bytecode_add_cf_end(ctx.bc);
/* check GPR limit - we have 124 = 128 - 4
* (4 are reserved as alu clause temporary registers) */
if (ctx.bc->ngpr > 124) {
R600_ERR("GPR limit exceeded - shader requires %d registers\n", ctx.bc->ngpr);
r = -ENOMEM;
goto out_err;
}
free(ctx.literals);
tgsi_parse_free(&ctx.parse);
return 0;
@@ -1453,6 +1461,11 @@ static int cayman_emit_float_instr(struct r600_shader_ctx *ctx)
alu.inst = ctx->inst_info->r600_opcode;
for (j = 0; j < inst->Instruction.NumSrcRegs; j++) {
r600_bytecode_src(&alu.src[j], &ctx->src[j], 0);
/* RSQ should take the absolute value of src */
if (ctx->inst_info->tgsi_opcode == TGSI_OPCODE_RSQ) {
r600_bytecode_src_set_abs(&alu.src[j]);
}
}
tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
@@ -2856,10 +2869,8 @@ static int tgsi_exp(struct r600_shader_ctx *ctx)
alu.dst.sel = ctx->temp_reg;
alu.dst.chan = i;
if (i == 0)
alu.dst.write = 1;
if (i == 2)
alu.last = 1;
alu.dst.write = i == 0;
alu.last = i == 2;
r = r600_bytecode_add_alu(ctx->bc, &alu);
if (r)
return r;

View File

@@ -158,8 +158,10 @@ softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
softpipe->fs = fs;
if (fs == NULL)
softpipe->fs_variant = NULL;
/* This depends on the current fragment shader and must always be
* re-validated before use.
*/
softpipe->fs_variant = NULL;
if (state)
draw_bind_fragment_shader(softpipe->draw,

View File

@@ -44,8 +44,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
const struct pipe_box *src_box)
{
struct svga_context *svga = svga_context(pipe);
struct svga_texture *stex = svga_texture(src_tex);
struct svga_texture *dtex = svga_texture(dst_tex);
struct svga_texture *stex, *dtex;
/* struct pipe_screen *screen = pipe->screen;
SVGA3dCopyBox *box;
enum pipe_error ret;
@@ -63,6 +62,9 @@ static void svga_surface_copy(struct pipe_context *pipe,
return;
}
stex = svga_texture(src_tex);
dtex = svga_texture(dst_tex);
#if 0
srcsurf = screen->get_tex_surface(screen, src_tex,
src_level, src_box->z, src_box->z,

View File

@@ -201,6 +201,17 @@ svga_release_user_upl_buffers(struct svga_context *svga)
if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
struct svga_buffer *buffer = svga_buffer(vb->buffer);
/* The buffer_offset is relative to the uploaded buffer.
* Since we're discarding that buffer we need to reset this offset
* so it's not inadvertantly applied to a subsequent draw.
*
* XXX a root problem here is that the svga->curr.vb[] information
* is getting set both by gallium API calls and by code in
* svga_upload_user_buffers(). We should instead have two copies
* of the vertex buffer information and choose between as needed.
*/
vb->buffer_offset = 0;
buffer->uploaded.start = ~0;
buffer->uploaded.end = 0;
if (buffer->uploaded.buffer)

View File

@@ -125,8 +125,8 @@ svga_create_sampler_state(struct pipe_context *pipe,
* - min/max LOD clamping
*/
cso->min_lod = 0;
cso->view_min_lod = MAX2(sampler->min_lod, 0);
cso->view_max_lod = MAX2(sampler->max_lod, 0);
cso->view_min_lod = MAX2((int) (sampler->min_lod + 0.5), 0);
cso->view_max_lod = MAX2((int) (sampler->max_lod + 0.5), 0);
/* Use min_mipmap */
if (svga->debug.use_min_mipmap) {

View File

@@ -120,7 +120,7 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
return result.u;
case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
return 16.0;
return 15.0;
default:
return 0;

View File

@@ -82,12 +82,14 @@ update_tss_binding(struct svga_context *svga,
const struct svga_sampler_state *s = svga->curr.sampler[i];
struct svga_hw_view_state *view = &svga->state.hw_draw.views[i];
struct pipe_resource *texture = NULL;
struct pipe_sampler_view *sv = svga->curr.sampler_views[i];
/* get min max lod */
if (svga->curr.sampler_views[i]) {
min_lod = MAX2(s->view_min_lod, 0);
max_lod = MIN2(s->view_max_lod, svga->curr.sampler_views[i]->texture->last_level);
texture = svga->curr.sampler_views[i]->texture;
if (sv) {
min_lod = MAX2(0, (s->view_min_lod + sv->u.tex.first_level));
max_lod = MIN2(s->view_max_lod, sv->texture->last_level);
max_lod += sv->u.tex.first_level;
texture = sv->texture;
} else {
min_lod = 0;
max_lod = 0;

View File

@@ -320,6 +320,11 @@ svga_mark_surface_dirty(struct pipe_surface *surf)
else {
/* this will happen later in svga_propagate_surface */
}
/* Increment the view_age and texture age for this surface's slice
* so that any sampler views into the texture are re-validated too.
*/
tex->view_age[surf->u.tex.first_layer] = ++(tex->age);
}
}

View File

@@ -2994,6 +2994,11 @@ needs_to_create_zero( struct svga_shader_emitter *emit )
emit->key.fkey.tex[i].swizzle_a > PIPE_SWIZZLE_ALPHA)
return TRUE;
}
for (i = 0; i < emit->key.fkey.num_textures; i++) {
if (emit->key.fkey.tex[i].compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
return TRUE;
}
}
if (emit->unit == PIPE_SHADER_VERTEX) {
@@ -3017,11 +3022,6 @@ needs_to_create_zero( struct svga_shader_emitter *emit )
emit->info.opcode_count[TGSI_OPCODE_KILP] >= 1)
return TRUE;
for (i = 0; i < emit->key.fkey.num_textures; i++) {
if (emit->key.fkey.tex[i].compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE)
return TRUE;
}
return FALSE;
}

View File

@@ -455,7 +455,7 @@ ximage_display_copy_to_pixmap(struct native_display *ndpy,
if (src->bind & PIPE_BIND_DISPLAY_TARGET) {
struct ximage_display *xdpy = ximage_display(ndpy);
enum pipe_format fmt = get_pixmap_format(&xdpy->base, pix);
const struct ximage_config *xconf;
const struct ximage_config *xconf = NULL;
struct xlib_drawable xdraw;
int i;

View File

@@ -526,8 +526,8 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx,
src += offset;
for (i = 0; i < n; ++i) {
VGfloat clr[4];
clr[0] = ((*src >> 10) & 31)/31.;
clr[1] = ((*src >> 5) & 95)/95.;
clr[0] = ((*src >> 11) & 31)/31.;
clr[1] = ((*src >> 5) & 63)/63.;
clr[2] = ((*src >> 0) & 31)/31.;
clr[3] = 1.f;

View File

@@ -46,7 +46,7 @@ endif
default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES)
$(MKLIB) -linker '$(LD)' -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
$(MKLIB) -linker '$(LD)' -noprefix -o $@ -ldflags '$(LDFLAGS)' $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
rm -f depend

View File

@@ -198,9 +198,10 @@ int radeon_get_reloc(struct radeon_cs_context *csc, struct radeon_bo *bo)
unsigned hash = bo->handle & (sizeof(csc->is_handle_added)-1);
if (csc->is_handle_added[hash]) {
reloc = csc->relocs_hashlist[hash];
i = csc->reloc_indices_hashlist[hash];
reloc = &csc->relocs[i];
if (reloc->handle == bo->handle) {
return csc->reloc_indices_hashlist[hash];
return i;
}
/* Hash collision, look for the BO in the list of relocs linearly. */
@@ -217,7 +218,6 @@ int radeon_get_reloc(struct radeon_cs_context *csc, struct radeon_bo *bo)
* AAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCC
* will collide here: ^ and here: ^,
* meaning that we should get very few collisions in the end. */
csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = i;
/*printf("write_reloc collision, hash: %i, handle: %i\n", hash, bo->handle);*/
return i;
@@ -241,10 +241,11 @@ static unsigned radeon_add_reloc(struct radeon_cs_context *csc,
enum radeon_bo_domain wd = usage & RADEON_USAGE_WRITE ? domains : 0;
if (csc->is_handle_added[hash]) {
reloc = csc->relocs_hashlist[hash];
i = csc->reloc_indices_hashlist[hash];
reloc = &csc->relocs[i];
if (reloc->handle == bo->handle) {
update_reloc_domains(reloc, rd, wd, added_domains);
return csc->reloc_indices_hashlist[hash];
return i;
}
/* Hash collision, look for the BO in the list of relocs linearly. */
@@ -254,7 +255,6 @@ static unsigned radeon_add_reloc(struct radeon_cs_context *csc,
if (reloc->handle == bo->handle) {
update_reloc_domains(reloc, rd, wd, added_domains);
csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = i;
/*printf("write_reloc collision, hash: %i, handle: %i\n", hash, bo->handle);*/
return i;
@@ -287,7 +287,6 @@ static unsigned radeon_add_reloc(struct radeon_cs_context *csc,
reloc->flags = 0;
csc->is_handle_added[hash] = TRUE;
csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = csc->crelocs;
csc->chunks[1].length_dw += RELOC_DWORDS;
@@ -472,7 +471,6 @@ static void radeon_drm_cs_destroy(struct radeon_winsys_cs *rcs)
pipe_semaphore_signal(&cs->flush_queued);
pipe_semaphore_wait(&cs->flush_completed);
pipe_thread_wait(cs->thread);
pipe_thread_destroy(cs->thread);
}
pipe_semaphore_destroy(&cs->flush_queued);
pipe_semaphore_destroy(&cs->flush_completed);

View File

@@ -48,7 +48,6 @@ struct radeon_cs_context {
/* 0 = BO not added, 1 = BO added */
char is_handle_added[256];
struct drm_radeon_cs_reloc *relocs_hashlist[256];
unsigned reloc_indices_hashlist[256];
unsigned used_vram;

View File

@@ -3735,13 +3735,10 @@ ast_case_label::hir(exec_list *instructions,
instructions->push_tail(set_fallthru_on_test);
} else { /* default case */
if (state->switch_state.previous_default) {
printf("a\n");
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state,
"multiple default labels in one switch");
printf("b\n");
loc = state->switch_state.previous_default->get_location();
_mesa_glsl_error(& loc, state,
"this is the first default label");

View File

@@ -2,21 +2,21 @@
(signature float
(parameters
(declare (in) float x))
((return (expression float - (constant float (1.5707963))
((return (expression float - (constant float (1.5707964))
(call asin ((var_ref x)))))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (expression vec2 - (constant float (1.5707963))
((return (expression vec2 - (constant float (1.5707964))
(call asin ((var_ref x)))))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (expression vec3 - (constant float (1.5707963))
((return (expression vec3 - (constant float (1.5707964))
(call asin ((var_ref x)))))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (expression vec4 - (constant float (1.5707963))
((return (expression vec4 - (constant float (1.5707964))
(call asin ((var_ref x)))))))
))

View File

@@ -54,7 +54,7 @@ def get_txs_dim(sampler_type):
def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
coord_dim = get_coord_dim(sampler_type)
extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields)
offset_dim = get_sampler_dim(sampler_type)
sampler_dim = get_sampler_dim(sampler_type)
if variant & Single:
return_type = "float"
@@ -74,12 +74,12 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
elif tex_inst == "txf" or tex_inst == "txs":
print "\n (declare (in) int lod)",
elif tex_inst == "txd":
grad_type = vec_type("", coord_dim)
grad_type = vec_type("", sampler_dim)
print "\n (declare (in) " + grad_type + " dPdx)",
print "\n (declare (in) " + grad_type + " dPdy)",
if variant & Offset:
print "\n (declare (const_in) " + vec_type("i", offset_dim) + " offset)",
print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)",
if tex_inst == "txb":
print "\n (declare (in) float bias)",

View File

@@ -292,7 +292,7 @@ pragma_statement:
| PRAGMA_OPTIMIZE_OFF EOL
| PRAGMA_INVARIANT_ALL EOL
{
if (state->language_version < 120) {
if (state->language_version == 110) {
_mesa_glsl_warning(& @1, state,
"pragma `invariant(all)' not supported in %s",
state->version_string);

View File

@@ -1158,7 +1158,6 @@ public:
{
this->ir_type = ir_type_loop_jump;
this->mode = mode;
this->loop = loop;
}
virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const;
@@ -1182,9 +1181,6 @@ public:
/** Mode selector for the jump instruction. */
enum jump_mode mode;
private:
/** Loop containing this break instruction. */
ir_loop *loop;
};
/**

View File

@@ -275,7 +275,7 @@ private:
const gl_texture_index target = base_type->sampler_index();
const unsigned shadow = base_type->sampler_shadow;
for (unsigned i = this->uniforms[id].sampler
; i < this->next_sampler
; i < MIN2(this->next_sampler, MAX_SAMPLERS)
; i++) {
this->targets[i] = target;
this->shader_samplers_used |= 1U << i;

View File

@@ -110,6 +110,8 @@ public:
virtual ir_visitor_status visit(ir_loop_jump *);
virtual ir_visitor_status visit(ir_dereference_variable *);
virtual ir_visitor_status visit_enter(ir_call *);
virtual ir_visitor_status visit_enter(ir_loop *);
virtual ir_visitor_status visit_leave(ir_loop *);
virtual ir_visitor_status visit_enter(ir_assignment *);
@@ -152,6 +154,21 @@ loop_analysis::visit(ir_loop_jump *ir)
}
ir_visitor_status
loop_analysis::visit_enter(ir_call *ir)
{
/* If we're not somewhere inside a loop, there's nothing to do. */
if (this->state.is_empty())
return visit_continue;
loop_variable_state *const ls =
(loop_variable_state *) this->state.get_head();
ls->contains_calls = true;
return visit_continue_with_parent;
}
ir_visitor_status
loop_analysis::visit(ir_dereference_variable *ir)
{
@@ -209,6 +226,17 @@ loop_analysis::visit_leave(ir_loop *ir)
loop_variable_state *const ls =
(loop_variable_state *) this->state.pop_head();
/* Function calls may contain side effects. These could alter any of our
* variables in ways that cannot be known, and may even terminate shader
* execution (say, calling discard in the fragment shader). So we can't
* rely on any of our analysis about assignments to variables.
*
* We could perform some conservative analysis (prove there's no statically
* possible assignment, etc.) but it isn't worth it for now; function
* inlining will allow us to unroll loops anyway.
*/
if (ls->contains_calls)
return visit_continue;
foreach_list(node, &ir->body_instructions) {
/* Skip over declarations at the start of a loop.

View File

@@ -122,10 +122,16 @@ public:
*/
unsigned num_loop_jumps;
/**
* Whether this loop contains any function calls.
*/
bool contains_calls;
loop_variable_state()
{
this->max_iterations = -1;
this->num_loop_jumps = 0;
this->contains_calls = false;
this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
hash_table_pointer_compare);
}
@@ -134,6 +140,23 @@ public:
{
hash_table_dtor(this->var_hash);
}
static void* operator new(size_t size, void *ctx)
{
void *lvs = ralloc_size(ctx, size);
assert(lvs != NULL);
ralloc_set_destructor(lvs, (void (*)(void*)) destructor);
return lvs;
}
private:
static void
destructor(loop_variable_state *lvs)
{
lvs->~loop_variable_state();
}
};

View File

@@ -278,7 +278,7 @@ ralloc_parent(const void *ptr)
return NULL;
info = get_header(ptr);
return PTR_FROM_HEADER(info->parent);
return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
}
static void *autofree_context = NULL;

View File

@@ -90,7 +90,7 @@ Mapdesc::setBboxsize( INREAL *mat )
void
Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] )
{
memset( dest, 0, sizeof( dest ) );
memset( dest, 0, sizeof( REAL ) * MAXCOORDS * MAXCOORDS );
for( int i=0; i != hcoords; i++ )
dest[i][i] = 1.0;
}

View File

@@ -505,7 +505,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve )
o_pwlcurve->owner = currentCurve;
}
if( (inCurve == 2) )
if( inCurve == 2 )
endcurve();
}

View File

@@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
*uses_stereo = false;
}
if (mode->doubleBufferMode) {
if (!offscreen && mode->doubleBufferMode) {
attr[numattr++] = kCGLPFADoubleBuffer;
*double_buffered = true;
}

View File

@@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
GLX_MINOR_VERSION),
NULL);
if (!reply)
return GL_FALSE;
if (reply->major_version != GLX_MAJOR_VERSION) {
free(reply);
return GL_FALSE;

View File

@@ -315,6 +315,10 @@ struct gl_meta_state
struct drawtex_state DrawTex; /**< For _mesa_meta_DrawTex() */
};
static void meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit);
static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex);
static void meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear);
static GLuint
compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB *source)
{
@@ -331,12 +335,16 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
return shader;
_mesa_GetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
if (size == 0)
if (size == 0) {
_mesa_DeleteObjectARB(shader);
return 0;
}
info = malloc(size);
if (!info)
if (!info) {
_mesa_DeleteObjectARB(shader);
return 0;
}
_mesa_GetProgramInfoLog(shader, size, NULL, info);
_mesa_problem(ctx,
@@ -345,6 +353,7 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
info, source);
free(info);
_mesa_DeleteObjectARB(shader);
return 0;
}
@@ -397,10 +406,15 @@ _mesa_meta_init(struct gl_context *ctx)
void
_mesa_meta_free(struct gl_context *ctx)
{
/* Note: Any textures, VBOs, etc, that we allocate should get
* freed by the normal context destruction code. But this would be
* the place to free other meta data someday.
*/
GET_CURRENT_CONTEXT(old_context);
_mesa_make_current(ctx, NULL, NULL);
meta_glsl_blit_cleanup(ctx, &ctx->Meta->Blit);
meta_glsl_clear_cleanup(ctx, &ctx->Meta->Clear);
cleanup_temp_texture(ctx, &ctx->Meta->TempTex);
if (old_context)
_mesa_make_current(old_context, old_context->WinSysDrawBuffer, old_context->WinSysReadBuffer);
else
_mesa_make_current(NULL, NULL, NULL);
free(ctx->Meta);
ctx->Meta = NULL;
}
@@ -1056,6 +1070,15 @@ init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
_mesa_GenTextures(1, &tex->TexObj);
}
static void
cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
{
if (!tex->TexObj)
return;
_mesa_DeleteTextures(1, &tex->TexObj);
tex->TexObj = 0;
}
/**
* Return pointer to temp_texture info for non-bitmap ops.
@@ -1592,6 +1615,21 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
}
}
static void
meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit)
{
if (blit->ArrayObj) {
_mesa_DeleteVertexArraysAPPLE(1, &blit->ArrayObj);
blit->ArrayObj = 0;
_mesa_DeleteBuffersARB(1, &blit->VBO);
blit->VBO = 0;
}
if (blit->DepthFP) {
_mesa_DeletePrograms(1, &blit->DepthFP);
blit->DepthFP = 0;
}
}
/**
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
@@ -1774,7 +1812,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
clear->ShaderProg = _mesa_CreateProgramObjectARB();
_mesa_AttachShader(clear->ShaderProg, fs);
_mesa_DeleteObjectARB(fs);
_mesa_AttachShader(clear->ShaderProg, vs);
_mesa_DeleteObjectARB(vs);
_mesa_BindAttribLocationARB(clear->ShaderProg, 0, "position");
_mesa_LinkProgramARB(clear->ShaderProg);
@@ -1787,7 +1827,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
clear->IntegerShaderProg = _mesa_CreateProgramObjectARB();
_mesa_AttachShader(clear->IntegerShaderProg, fs);
_mesa_DeleteObjectARB(fs);
_mesa_AttachShader(clear->IntegerShaderProg, vs);
_mesa_DeleteObjectARB(vs);
_mesa_BindAttribLocationARB(clear->IntegerShaderProg, 0, "position");
/* Note that user-defined out attributes get automatically assigned
@@ -1802,6 +1844,24 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
}
}
static void
meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear)
{
if (clear->ArrayObj == 0)
return;
_mesa_DeleteVertexArraysAPPLE(1, &clear->ArrayObj);
clear->ArrayObj = 0;
_mesa_DeleteBuffersARB(1, &clear->VBO);
clear->VBO = 0;
_mesa_DeleteObjectARB(clear->ShaderProg);
clear->ShaderProg = 0;
if (clear->IntegerShaderProg) {
_mesa_DeleteObjectARB(clear->IntegerShaderProg);
clear->IntegerShaderProg = 0;
}
}
/**
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
*/
@@ -2193,8 +2253,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
* Determine if we can do the glDrawPixels with texture mapping.
*/
fallback = GL_FALSE;
if (ctx->_ImageTransferState ||
ctx->Fog.Enabled) {
if (ctx->Fog.Enabled) {
fallback = GL_TRUE;
}
@@ -2229,6 +2288,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
texIntFormat = GL_ALPHA;
metaExtraSave = (MESA_META_COLOR_MASK |
MESA_META_DEPTH_TEST |
MESA_META_PIXEL_TRANSFER |
MESA_META_SHADER |
MESA_META_STENCIL_TEST);
}
@@ -3256,6 +3316,7 @@ decompress_texture_image(struct gl_context *ctx,
};
struct vertex verts[4];
GLuint fboDrawSave, fboReadSave;
GLuint rbSave;
if (slice > 0) {
assert(target == GL_TEXTURE_3D ||
@@ -3272,6 +3333,7 @@ decompress_texture_image(struct gl_context *ctx,
/* save fbo bindings (not saved by _mesa_meta_begin()) */
fboDrawSave = ctx->DrawBuffer->Name;
fboReadSave = ctx->ReadBuffer->Name;
rbSave = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
_mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE);
@@ -3292,6 +3354,7 @@ decompress_texture_image(struct gl_context *ctx,
/* alloc dest surface */
if (width > decompress->Width || height > decompress->Height) {
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, decompress->RBO);
_mesa_RenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA,
width, height);
decompress->Width = width;
@@ -3424,6 +3487,7 @@ decompress_texture_image(struct gl_context *ctx,
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboDrawSave);
_mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboReadSave);
}
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbSave);
}

View File

@@ -173,12 +173,6 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
return NULL;
}
if (mesa_api != API_OPENGL && num_attribs != 0) {
*error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
assert(!"Should not get here.");
return NULL;
}
for (unsigned i = 0; i < num_attribs; i++) {
switch (attribs[i * 2]) {
case __DRI_CTX_ATTRIB_MAJOR_VERSION:
@@ -200,6 +194,23 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
}
}
/* The EGL_KHR_create_context spec says:
*
* "Flags are only defined for OpenGL context creation, and specifying
* a flags value other than zero for other types of contexts,
* including OpenGL ES contexts, will generate an error."
*
* The GLX_EXT_create_context_es2_profile specification doesn't say
* anything specific about this case. However, none of the known flags
* have any meaning in an ES context, so this seems safe.
*/
if (mesa_api != __DRI_API_OPENGL
&& mesa_api != __DRI_API_OPENGL_CORE
&& flags != 0) {
*error = __DRI_CTX_ERROR_BAD_FLAG;
return NULL;
}
/* There are no forward-compatible contexts before OpenGL 3.0. The
* GLX_ARB_create_context spec says:
*
@@ -221,7 +232,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
return NULL;
}
context = malloc(sizeof *context);
context = calloc(1, sizeof *context);
if (!context) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
return NULL;

View File

@@ -86,7 +86,7 @@ static const char *__getProgramName () {
#endif
#if !defined(GET_PROGRAM_NAME)
# if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__)
# if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__) || defined(ANDROID)
/* This is a hack. It's said to work on OpenBSD, NetBSD and GNU.
* Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's
* used as a last resort, if there is no documented facility available. */

View File

@@ -30,6 +30,7 @@
#include "main/context.h"
#include "main/macros.h"
#include "main/enums.h"
#include "main/fbobject.h"
#include "main/dd.h"
#include "main/state.h"
@@ -545,7 +546,7 @@ i830Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
if (ctx->DrawBuffer->Name == 0) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
x1 = x;
y1 = ctx->DrawBuffer->Height - (y + h);
x2 = x + w - 1;
@@ -861,7 +862,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
if (ctx->DrawBuffer) {
struct intel_renderbuffer *irbStencil
= intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
hw_stencil = (irbStencil && irbStencil->mt->region);
hw_stencil = (irbStencil && irbStencil->mt);
}
if (hw_stencil) {
I830_STATECHANGE(i830, I830_UPLOAD_CTX);

View File

@@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
GLubyte border[4];
GLuint dst_x, dst_y;
memset(state, 0, sizeof(state));
memset(state, 0, sizeof(*state));
/*We need to refcount these. */

View File

@@ -30,6 +30,7 @@
#include "main/context.h"
#include "main/macros.h"
#include "main/enums.h"
#include "main/fbobject.h"
#include "main/dd.h"
#include "main/state.h"
#include "tnl/tnl.h"
@@ -400,7 +401,7 @@ intelCalcViewport(struct gl_context * ctx)
{
struct intel_context *intel = intel_context(ctx);
if (ctx->DrawBuffer->Name == 0) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
_math_matrix_viewport(&intel->ViewportMatrix,
ctx->Viewport.X,
ctx->DrawBuffer->Height - ctx->Viewport.Y,
@@ -518,7 +519,7 @@ i915Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
if (ctx->DrawBuffer->Name == 0) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
x1 = x;
y1 = ctx->DrawBuffer->Height - (y + h);
x2 = x + w - 1;
@@ -577,7 +578,7 @@ i915CullFaceFrontFace(struct gl_context * ctx, GLenum unused)
else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
mode = S4_CULLMODE_CW;
if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
if (ctx->DrawBuffer && _mesa_is_user_fbo(ctx->DrawBuffer))
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
if (ctx->Polygon.CullFaceMode == GL_FRONT)
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);

View File

@@ -240,7 +240,7 @@ brwCreateContext(int api,
/* WM maximum threads is number of EUs times number of threads per EU. */
if (intel->gen >= 7) {
if (intel->gt == 1) {
brw->max_wm_threads = 86;
brw->max_wm_threads = 48;
brw->max_vs_threads = 36;
brw->max_gs_threads = 36;
brw->urb.size = 128;

View File

@@ -692,6 +692,16 @@ static void brw_emit_vertices(struct brw_context *brw)
uint32_t comp2 = BRW_VE1_COMPONENT_STORE_SRC;
uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC;
/* The gen4 driver expects edgeflag to come in as a float, and passes
* that float on to the tests in the clipper. Mesa's current vertex
* attribute value for EdgeFlag is stored as a float, which works out.
* glEdgeFlagPointer, on the other hand, gives us an unnormalized
* integer ubyte. Just rewrite that to convert to a float.
*/
if (input->attrib == VERT_ATTRIB_EDGEFLAG &&
format == BRW_SURFACEFORMAT_R8_UINT)
format = BRW_SURFACEFORMAT_R8_SSCALED;
switch (input->glarray->Size) {
case 0: comp0 = BRW_VE1_COMPONENT_STORE_0;
case 1: comp1 = BRW_VE1_COMPONENT_STORE_0;

View File

@@ -47,13 +47,13 @@ brw_swap_cmod(uint32_t cmod)
case BRW_CONDITIONAL_NZ:
return cmod;
case BRW_CONDITIONAL_G:
return BRW_CONDITIONAL_LE;
case BRW_CONDITIONAL_GE:
return BRW_CONDITIONAL_L;
case BRW_CONDITIONAL_GE:
return BRW_CONDITIONAL_LE;
case BRW_CONDITIONAL_L:
return BRW_CONDITIONAL_GE;
case BRW_CONDITIONAL_LE:
return BRW_CONDITIONAL_G;
case BRW_CONDITIONAL_LE:
return BRW_CONDITIONAL_GE;
default:
return ~0;
}

View File

@@ -974,7 +974,6 @@ void brw_SAMPLE(struct brw_compile *p,
void brw_math_16( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint precision );
@@ -982,7 +981,6 @@ void brw_math_16( struct brw_compile *p,
void brw_math( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint data_type,

View File

@@ -429,7 +429,6 @@ static void brw_set_math_message( struct brw_compile *p,
GLuint function,
GLuint integer_type,
bool low_precision,
bool saturate,
GLuint dataType )
{
struct brw_context *brw = p->brw;
@@ -461,22 +460,24 @@ static void brw_set_math_message( struct brw_compile *p,
break;
}
brw_set_message_descriptor(p, insn, BRW_SFID_MATH,
msg_length, response_length, false, false);
if (intel->gen == 5) {
insn->bits3.math_gen5.function = function;
insn->bits3.math_gen5.int_type = integer_type;
insn->bits3.math_gen5.precision = low_precision;
insn->bits3.math_gen5.saturate = saturate;
insn->bits3.math_gen5.saturate = insn->header.saturate;
insn->bits3.math_gen5.data_type = dataType;
insn->bits3.math_gen5.snapshot = 0;
} else {
insn->bits3.math.function = function;
insn->bits3.math.int_type = integer_type;
insn->bits3.math.precision = low_precision;
insn->bits3.math.saturate = saturate;
insn->bits3.math.saturate = insn->header.saturate;
insn->bits3.math.data_type = dataType;
}
insn->header.saturate = 0;
}
@@ -1567,7 +1568,6 @@ void brw_WAIT (struct brw_compile *p)
void brw_math( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint data_type,
@@ -1603,7 +1603,6 @@ void brw_math( struct brw_compile *p,
* becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
*/
insn->header.destreg__conditionalmod = function;
insn->header.saturate = saturate;
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src);
@@ -1624,7 +1623,6 @@ void brw_math( struct brw_compile *p,
function,
src.type == BRW_REGISTER_TYPE_D,
precision,
saturate,
data_type);
}
}
@@ -1689,7 +1687,6 @@ void brw_math2(struct brw_compile *p,
void brw_math_16( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint precision )
@@ -1704,7 +1701,6 @@ void brw_math_16( struct brw_compile *p,
* becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
*/
insn->header.destreg__conditionalmod = function;
insn->header.saturate = saturate;
/* Source modifiers are ignored for extended math instructions. */
assert(!src.negate);
@@ -1732,7 +1728,6 @@ void brw_math_16( struct brw_compile *p,
function,
BRW_MATH_INTEGER_UNSIGNED,
precision,
saturate,
BRW_MATH_DATA_VECTOR);
/* Second instruction:
@@ -1748,7 +1743,6 @@ void brw_math_16( struct brw_compile *p,
function,
BRW_MATH_INTEGER_UNSIGNED,
precision,
saturate,
BRW_MATH_DATA_VECTOR);
brw_pop_insn_state(p);

View File

@@ -42,7 +42,6 @@ void brw_math_invert( struct brw_compile *p,
brw_math( p,
dst,
BRW_MATH_FUNCTION_INV,
BRW_MATH_SATURATE_NONE,
0,
src,
BRW_MATH_PRECISION_FULL,

View File

@@ -35,6 +35,7 @@ extern "C" {
#include "main/macros.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
#include "main/fbobject.h"
#include "program/prog_parameter.h"
#include "program/prog_print.h"
#include "program/register_allocate.h"
@@ -717,7 +718,7 @@ fs_visitor::calculate_urb_setup()
*
* See compile_sf_prog() for more info.
*/
if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC))
if (fp->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC))
urb_setup[FRAG_ATTRIB_PNTC] = urb_next++;
}
@@ -1595,6 +1596,9 @@ fs_visitor::compute_to_mrf()
}
}
if (progress)
live_intervals_valid = false;
return progress;
}
@@ -1671,6 +1675,9 @@ fs_visitor::remove_duplicate_mrf_writes()
}
}
if (progress)
live_intervals_valid = false;
return progress;
}
@@ -1877,6 +1884,13 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
struct brw_context *brw = brw_context(ctx);
struct brw_wm_prog_key key;
/* As a temporary measure we assume that all programs use dFdy() (and hence
* need to be compiled differently depending on whether we're rendering to
* an FBO). FIXME: set this bool correctly based on the contents of the
* program.
*/
bool program_uses_dfdy = true;
if (!prog->_LinkedShaders[MESA_SHADER_FRAGMENT])
return true;
@@ -1921,7 +1935,10 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
if (fp->Base.InputsRead & FRAG_BIT_WPOS) {
key.drawable_height = ctx->DrawBuffer->Height;
key.render_to_fbo = ctx->DrawBuffer->Name != 0;
}
if ((fp->Base.InputsRead & FRAG_BIT_WPOS) || program_uses_dfdy) {
key.render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
}
key.nr_color_regions = 1;

View File

@@ -410,6 +410,7 @@ public:
this->frag_depth = NULL;
memset(this->outputs, 0, sizeof(this->outputs));
memset(this->output_components, 0, sizeof(this->output_components));
this->first_non_payload_grf = 0;
this->max_grf = intel->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF;
@@ -542,7 +543,8 @@ public:
struct brw_reg src);
void generate_discard(fs_inst *inst);
void generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src);
void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src);
void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src,
bool negate_value);
void generate_spill(fs_inst *inst, struct brw_reg src);
void generate_unspill(fs_inst *inst, struct brw_reg dst);
void generate_pull_constant_load(fs_inst *inst, struct brw_reg dst);
@@ -617,6 +619,7 @@ public:
struct hash_table *variable_ht;
ir_variable *frag_depth;
fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
unsigned output_components[BRW_MAX_DRAW_BUFFERS];
int first_non_payload_grf;
int max_grf;
int urb_setup[FRAG_ATTRIB_MAX];

View File

@@ -194,8 +194,6 @@ fs_visitor::generate_math1_gen7(fs_inst *inst,
assert(inst->mlen == 0);
brw_math(p, dst,
brw_math_function(inst->opcode),
inst->saturate ? BRW_MATH_SATURATE_SATURATE
: BRW_MATH_SATURATE_NONE,
0, src0,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -223,8 +221,6 @@ fs_visitor::generate_math1_gen6(fs_inst *inst,
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p, dst,
op,
inst->saturate ? BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE,
0, src0,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -233,8 +229,6 @@ fs_visitor::generate_math1_gen6(fs_inst *inst,
brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
brw_math(p, sechalf(dst),
op,
inst->saturate ? BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE,
0, sechalf(src0),
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -274,8 +268,6 @@ fs_visitor::generate_math_gen4(fs_inst *inst,
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p, dst,
op,
inst->saturate ? BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE,
inst->base_mrf, src,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -284,8 +276,6 @@ fs_visitor::generate_math_gen4(fs_inst *inst,
brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
brw_math(p, sechalf(dst),
op,
inst->saturate ? BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE,
inst->base_mrf + 1, sechalf(src),
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -475,8 +465,13 @@ fs_visitor::generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src)
brw_ADD(p, dst, src0, negate(src1));
}
/* The negate_value boolean is used to negate the derivative computation for
* FBOs, since they place the origin at the upper left instead of the lower
* left.
*/
void
fs_visitor::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src)
fs_visitor::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src,
bool negate_value)
{
struct brw_reg src0 = brw_reg(src.file, src.nr, 0,
BRW_REGISTER_TYPE_F,
@@ -490,7 +485,10 @@ fs_visitor::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src)
BRW_WIDTH_4,
BRW_HORIZONTAL_STRIDE_0,
BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
brw_ADD(p, dst, src0, negate(src1));
if (negate_value)
brw_ADD(p, dst, src1, negate(src0));
else
brw_ADD(p, dst, src0, negate(src1));
}
void
@@ -913,7 +911,7 @@ fs_visitor::generate_code()
generate_ddx(inst, dst, src[0]);
break;
case FS_OPCODE_DDY:
generate_ddy(inst, dst, src[0]);
generate_ddy(inst, dst, src[0], c->key.render_to_fbo);
break;
case FS_OPCODE_SPILL:

View File

@@ -76,6 +76,7 @@ fs_visitor::visit(ir_variable *ir)
/* Writing gl_FragColor outputs to all color regions. */
for (int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) {
this->outputs[i] = *reg;
this->output_components[i] = 4;
}
} else if (ir->location == FRAG_RESULT_DEPTH) {
this->frag_depth = ir;
@@ -84,11 +85,16 @@ fs_visitor::visit(ir_variable *ir)
assert(ir->location >= FRAG_RESULT_DATA0 &&
ir->location < FRAG_RESULT_DATA0 + BRW_MAX_DRAW_BUFFERS);
int vector_elements =
ir->type->is_array() ? ir->type->fields.array->vector_elements
: ir->type->vector_elements;
/* General color output. */
for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) {
int output = ir->location - FRAG_RESULT_DATA0 + i;
this->outputs[output] = *reg;
this->outputs[output].reg_offset += 4 * i;
this->outputs[output].reg_offset += vector_elements * i;
this->output_components[output] = vector_elements;
}
}
} else if (ir->mode == ir_var_uniform) {
@@ -820,20 +826,36 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate,
const int vector_elements =
ir->coordinate ? ir->coordinate->type->vector_elements : 0;
if (ir->offset) {
/* The offsets set up by the ir_texture visitor are in the
* m1 header, so we can't go headerless.
if (ir->offset != NULL && ir->op == ir_txf) {
/* It appears that the ld instruction used for txf does its
* address bounds check before adding in the offset. To work
* around this, just add the integer offset to the integer texel
* coordinate, and don't put the offset in the header.
*/
header_present = true;
mlen++;
base_mrf--;
}
ir_constant *offset = ir->offset->as_constant();
for (int i = 0; i < vector_elements; i++) {
emit(BRW_OPCODE_ADD,
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
coordinate,
offset->value.i[i]);
coordinate.reg_offset++;
}
} else {
if (ir->offset) {
/* The offsets set up by the ir_texture visitor are in the
* m1 header, so we can't go headerless.
*/
header_present = true;
mlen++;
base_mrf--;
}
for (int i = 0; i < vector_elements; i++) {
emit(BRW_OPCODE_MOV,
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
coordinate);
coordinate.reg_offset++;
for (int i = 0; i < vector_elements; i++) {
emit(BRW_OPCODE_MOV,
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
coordinate);
coordinate.reg_offset++;
}
}
mlen += vector_elements * reg_width;
@@ -2027,7 +2049,7 @@ fs_visitor::emit_fb_writes()
this->current_annotation = ralloc_asprintf(this->mem_ctx,
"FB write target %d",
target);
for (int i = 0; i < 4; i++)
for (unsigned i = 0; i < this->output_components[target]; i++)
emit_color_write(target, i, color_mrf);
fs_inst *inst = emit(FS_OPCODE_FB_WRITE);

View File

@@ -40,6 +40,8 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "main/fbobject.h"
/* Constant single cliprect for framebuffer object or DRI2 drawing */
static void upload_drawing_rect(struct brw_context *brw)
{
@@ -376,6 +378,26 @@ static void emit_depthbuffer(struct brw_context *brw)
assert(intel->gen < 6 || region->tiling == I915_TILING_Y);
assert(!hiz_region || region->tiling == I915_TILING_Y);
/* According to the Sandy Bridge PRM, volume 2 part 1, pp326-327
* (3DSTATE_DEPTH_BUFFER dw5), in the documentation for "Depth
* Coordinate Offset X/Y":
*
* "The 3 LSBs of both offsets must be zero to ensure correct
* alignment"
*
* We have no guarantee that tile_x and tile_y are correctly aligned,
* since they are determined by the mipmap layout, which is only aligned
* to multiples of 4.
*
* So, to avoid hanging the GPU, just smash the low order 3 bits of
* tile_x and tile_y to 0. This is a temporary workaround until we come
* up with a better solution.
*/
if (intel->gen >= 6) {
tile_x &= ~7;
tile_y &= ~7;
}
BEGIN_BATCH(len);
OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (len - 2));
OUT_BATCH(((region->pitch * region->cpp) - 1) |
@@ -506,7 +528,7 @@ static void upload_polygon_stipple(struct brw_context *brw)
* to a FBO (i.e. any named frame buffer object), we *don't*
* need to invert - we already match the layout.
*/
if (ctx->DrawBuffer->Name == 0) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
for (i = 0; i < 32; i++)
OUT_BATCH(ctx->PolygonStipple[31 - i]); /* invert */
}
@@ -549,15 +571,13 @@ static void upload_polygon_stipple_offset(struct brw_context *brw)
/* _NEW_BUFFERS
*
* If we're drawing to a system window (ctx->DrawBuffer->Name == 0),
* we have to invert the Y axis in order to match the OpenGL
* pixel coordinate system, and our offset must be matched
* to the window position. If we're drawing to a FBO
* (ctx->DrawBuffer->Name != 0), then our native pixel coordinate
* system works just fine, and there's no window system to
* worry about.
* If we're drawing to a system window we have to invert the Y axis
* in order to match the OpenGL pixel coordinate system, and our
* offset must be matched to the window position. If we're drawing
* to a user-created FBO then our native pixel coordinate system
* works just fine, and there's no window system to worry about.
*/
if (brw->intel.ctx.DrawBuffer->Name == 0)
if (_mesa_is_winsys_fbo(brw->intel.ctx.DrawBuffer))
OUT_BATCH((32 - (ctx->DrawBuffer->Height & 31)) & 31);
else
OUT_BATCH(0);

View File

@@ -32,7 +32,9 @@
#include "main/glheader.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/enums.h"
#include "main/fbobject.h"
#include "intel_batchbuffer.h"
@@ -136,7 +138,7 @@ brw_upload_sf_prog(struct brw_context *brw)
struct gl_context *ctx = &brw->intel.ctx;
struct brw_sf_prog_key key;
/* _NEW_BUFFERS */
bool render_to_fbo = ctx->DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
memset(&key, 0, sizeof(key));

View File

@@ -314,7 +314,6 @@ static void invert_det( struct brw_sf_compile *c)
brw_math(&c->func,
c->inv_det,
BRW_MATH_FUNCTION_INV,
BRW_MATH_SATURATE_NONE,
0,
c->det,
BRW_MATH_DATA_SCALAR,
@@ -599,7 +598,6 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
brw_math(&c->func,
c->tmp,
BRW_MATH_FUNCTION_INV,
BRW_MATH_SATURATE_NONE,
0,
c->dx0,
BRW_MATH_DATA_SCALAR,

View File

@@ -31,10 +31,12 @@
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/fbobject.h"
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
#include "main/macros.h"
#include "brw_sf.h"
static void upload_sf_vp(struct brw_context *brw)
@@ -44,7 +46,7 @@ static void upload_sf_vp(struct brw_context *brw)
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
@@ -142,7 +144,7 @@ static void upload_sf_unit( struct brw_context *brw )
struct brw_sf_unit_state *sf;
drm_intel_bo *bo = intel->batch.bo;
int chipset_max_threads;
bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
sf = brw_state_batch(brw, AUB_TRACE_SF_STATE,
sizeof(*sf), 64, &brw->sf.state_offset);

View File

@@ -262,7 +262,6 @@ vec4_visitor::generate_math1_gen4(vec4_instruction *inst,
brw_math(p,
dst,
brw_math_function(inst->opcode),
BRW_MATH_SATURATE_NONE,
inst->base_mrf,
src,
BRW_MATH_DATA_VECTOR,
@@ -291,7 +290,6 @@ vec4_visitor::generate_math1_gen6(vec4_instruction *inst,
brw_math(p,
dst,
brw_math_function(inst->opcode),
BRW_MATH_SATURATE_NONE,
inst->base_mrf,
src,
BRW_MATH_DATA_SCALAR,
@@ -355,7 +353,6 @@ vec4_visitor::generate_math2_gen4(vec4_instruction *inst,
brw_math(p,
dst,
brw_math_function(inst->opcode),
BRW_MATH_SATURATE_NONE,
inst->base_mrf,
op0,
BRW_MATH_DATA_VECTOR,

View File

@@ -1793,6 +1793,42 @@ vec4_visitor::visit(ir_texture *ir)
/* Should be lowered by do_lower_texture_projection */
assert(!ir->projector);
/* Generate code to compute all the subexpression trees. This has to be
* done before loading any values into MRFs for the sampler message since
* generating these values may involve SEND messages that need the MRFs.
*/
src_reg coordinate;
if (ir->coordinate) {
ir->coordinate->accept(this);
coordinate = this->result;
}
src_reg shadow_comparitor;
if (ir->shadow_comparitor) {
ir->shadow_comparitor->accept(this);
shadow_comparitor = this->result;
}
src_reg lod, dPdx, dPdy;
switch (ir->op) {
case ir_txf:
case ir_txl:
case ir_txs:
ir->lod_info.lod->accept(this);
lod = this->result;
break;
case ir_txd:
ir->lod_info.grad.dPdx->accept(this);
dPdx = this->result;
ir->lod_info.grad.dPdy->accept(this);
dPdy = this->result;
break;
case ir_tex:
case ir_txb:
break;
}
vec4_instruction *inst = NULL;
switch (ir->op) {
case ir_tex:
@@ -1820,17 +1856,16 @@ vec4_visitor::visit(ir_texture *ir)
inst->dst = dst_reg(this, ir->type);
inst->shadow_compare = ir->shadow_comparitor != NULL;
if (ir->offset != NULL)
if (ir->offset != NULL && ir->op != ir_txf)
inst->texture_offset = brw_texture_offset(ir->offset->as_constant());
/* MRF for the first parameter */
int param_base = inst->base_mrf + inst->header_present;
if (ir->op == ir_txs) {
ir->lod_info.lod->accept(this);
int writemask = intel->gen == 4 ? WRITEMASK_W : WRITEMASK_X;
emit(MOV(dst_reg(MRF, param_base, ir->lod_info.lod->type, writemask),
this->result));
lod));
} else {
int i, coord_mask = 0, zero_mask = 0;
/* Load the coordinate */
@@ -1840,17 +1875,35 @@ vec4_visitor::visit(ir_texture *ir)
for (; i < 4; i++)
zero_mask |= (1 << i);
ir->coordinate->accept(this);
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
this->result));
if (ir->offset && ir->op == ir_txf) {
/* It appears that the ld instruction used for txf does its
* address bounds check before adding in the offset. To work
* around this, just add the integer offset to the integer
* texel coordinate, and don't put the offset in the header.
*/
ir_constant *offset = ir->offset->as_constant();
assert(offset);
for (int j = 0; j < ir->coordinate->type->vector_elements; j++) {
src_reg src = coordinate;
src.swizzle = BRW_SWIZZLE4(BRW_GET_SWZ(src.swizzle, j),
BRW_GET_SWZ(src.swizzle, j),
BRW_GET_SWZ(src.swizzle, j),
BRW_GET_SWZ(src.swizzle, j));
emit(ADD(dst_reg(MRF, param_base, ir->coordinate->type, 1 << j),
src, offset->value.i[j]));
}
} else {
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
coordinate));
}
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
src_reg(0)));
/* Load the shadow comparitor */
if (ir->shadow_comparitor) {
ir->shadow_comparitor->accept(this);
emit(MOV(dst_reg(MRF, param_base + 1, ir->shadow_comparitor->type,
WRITEMASK_X),
this->result));
shadow_comparitor));
inst->mlen++;
}
@@ -1870,21 +1923,13 @@ vec4_visitor::visit(ir_texture *ir)
mrf = param_base;
writemask = WRITEMASK_Z;
}
ir->lod_info.lod->accept(this);
emit(MOV(dst_reg(MRF, mrf, ir->lod_info.lod->type, writemask),
this->result));
emit(MOV(dst_reg(MRF, mrf, ir->lod_info.lod->type, writemask), lod));
} else if (ir->op == ir_txf) {
ir->lod_info.lod->accept(this);
emit(MOV(dst_reg(MRF, param_base, ir->lod_info.lod->type, WRITEMASK_W),
this->result));
lod));
} else if (ir->op == ir_txd) {
const glsl_type *type = ir->lod_info.grad.dPdx->type;
ir->lod_info.grad.dPdx->accept(this);
src_reg dPdx = this->result;
ir->lod_info.grad.dPdy->accept(this);
src_reg dPdy = this->result;
if (intel->gen >= 5) {
dPdx.swizzle = BRW_SWIZZLE4(SWIZZLE_X,SWIZZLE_X,SWIZZLE_Y,SWIZZLE_Y);
dPdy.swizzle = BRW_SWIZZLE4(SWIZZLE_X,SWIZZLE_X,SWIZZLE_Y,SWIZZLE_Y);

View File

@@ -143,14 +143,12 @@ static void calc_sizes( struct tracker *t )
/* Examine vertex program output sizes to set the size_masks[] info
* which describes the fragment program input sizes.
*/
for (vertRes = VERT_RESULT_TEX0; vertRes < VERT_RESULT_MAX; vertRes++) {
for (vertRes = 0; vertRes < VERT_RESULT_MAX; vertRes++) {
/* map vertex program output index to fragment program input index */
GLint fragAttrib = _mesa_vert_result_to_frag_attrib(vertRes);
if (fragAttrib < 0)
continue;
assert(fragAttrib >= FRAG_ATTRIB_TEX0);
assert(fragAttrib <= FRAG_ATTRIB_MAX);
switch (get_output_size(t, vertRes)) {
case 4: t->size_masks[4-1] |= 1 << fragAttrib;

View File

@@ -677,7 +677,6 @@ static void emit_math1_gen4(struct brw_vs_compile *c,
brw_math(p,
tmp,
function,
BRW_MATH_SATURATE_NONE,
2,
arg0,
BRW_MATH_DATA_SCALAR,
@@ -712,7 +711,6 @@ emit_math1_gen6(struct brw_vs_compile *c,
brw_math(p,
tmp_dst,
function,
BRW_MATH_SATURATE_NONE,
2,
tmp_src,
BRW_MATH_DATA_SCALAR,
@@ -764,7 +762,6 @@ static void emit_math2_gen4( struct brw_vs_compile *c,
brw_math(p,
tmp,
function,
BRW_MATH_SATURATE_NONE,
2,
arg0,
BRW_MATH_DATA_SCALAR,
@@ -1753,7 +1750,7 @@ accumulator_contains(struct brw_vs_compile *c, struct brw_reg val)
if (val.address_mode != BRW_ADDRESS_DIRECT)
return false;
if (val.negate || val.abs)
if (val.negate || val.abs || val.dw1.bits.swizzle != BRW_SWIZZLE_XYZW)
return false;
switch (prev_insn->header.opcode) {

View File

@@ -33,6 +33,7 @@
#include "brw_wm.h"
#include "brw_state.h"
#include "main/formats.h"
#include "main/fbobject.h"
#include "main/samplerobj.h"
#include "program/prog_parameter.h"
@@ -417,6 +418,13 @@ static void brw_wm_populate_key( struct brw_context *brw,
GLuint line_aa;
GLuint i;
/* As a temporary measure we assume that all programs use dFdy() (and hence
* need to be compiled differently depending on whether we're rendering to
* an FBO). FIXME: set this bool correctly based on the contents of the
* program.
*/
bool program_uses_dfdy = true;
memset(key, 0, sizeof(*key));
/* Build the index for table lookup
@@ -515,7 +523,10 @@ static void brw_wm_populate_key( struct brw_context *brw,
*/
if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) {
key->drawable_height = ctx->DrawBuffer->Height;
key->render_to_fbo = ctx->DrawBuffer->Name != 0;
}
if ((fp->program.Base.InputsRead & FRAG_BIT_WPOS) || program_uses_dfdy) {
key->render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
}
/* _NEW_BUFFERS */

View File

@@ -346,7 +346,8 @@ void emit_ddxy(struct brw_compile *p,
const struct brw_reg *dst,
GLuint mask,
bool is_ddx,
const struct brw_reg *arg0);
const struct brw_reg *arg0,
bool negate_value);
void emit_delta_xy(struct brw_compile *p,
const struct brw_reg *dst,
GLuint mask,

View File

@@ -297,13 +297,11 @@ void emit_pixel_w(struct brw_wm_compile *c,
if (c->dispatch_width == 16) {
brw_math_16(p, dst[3],
BRW_MATH_FUNCTION_INV,
BRW_MATH_SATURATE_NONE,
2, src,
BRW_MATH_PRECISION_FULL);
} else {
brw_math(p, dst[3],
BRW_MATH_FUNCTION_INV,
BRW_MATH_SATURATE_NONE,
2, src,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
@@ -457,12 +455,16 @@ void emit_frontfacing(struct brw_compile *p,
* between each other. We could probably do it like ddx and swizzle the right
* order later, but bail for now and just produce
* ((ss0.tl - ss0.bl)x4 (ss1.tl - ss1.bl)x4)
*
* The negate_value boolean is used to negate the d/dy computation for FBOs,
* since they place the origin at the upper left instead of the lower left.
*/
void emit_ddxy(struct brw_compile *p,
const struct brw_reg *dst,
GLuint mask,
bool is_ddx,
const struct brw_reg *arg0)
const struct brw_reg *arg0,
bool negate_value)
{
int i;
struct brw_reg src0, src1;
@@ -498,7 +500,10 @@ void emit_ddxy(struct brw_compile *p,
BRW_HORIZONTAL_STRIDE_0,
BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
}
brw_ADD(p, dst[i], src0, negate(src1));
if (negate_value)
brw_ADD(p, dst[i], src1, negate(src0));
else
brw_ADD(p, dst[i], src0, negate(src1));
}
}
if (mask & SATURATE)
@@ -883,9 +888,6 @@ void emit_math1(struct brw_wm_compile *c,
struct brw_compile *p = &c->func;
struct intel_context *intel = &p->brw->intel;
int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1;
GLuint saturate = ((mask & SATURATE) ?
BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE);
struct brw_reg src;
if (!(mask & WRITEMASK_XYZW))
@@ -911,11 +913,11 @@ void emit_math1(struct brw_wm_compile *c,
/* Send two messages to perform all 16 operations:
*/
brw_push_insn_state(p);
brw_set_saturate(p, (mask & SATURATE) ? 1 : 0);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p,
dst[dst_chan],
function,
saturate,
2,
src,
BRW_MATH_DATA_VECTOR,
@@ -926,7 +928,6 @@ void emit_math1(struct brw_wm_compile *c,
brw_math(p,
offset(dst[dst_chan],1),
function,
saturate,
3,
sechalf(src),
BRW_MATH_DATA_VECTOR,
@@ -998,10 +999,6 @@ void emit_math2(struct brw_wm_compile *c,
sechalf(src1));
}
} else {
GLuint saturate = ((mask & SATURATE) ?
BRW_MATH_SATURATE_SATURATE :
BRW_MATH_SATURATE_NONE);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_MOV(p, brw_message_reg(3), arg1[0]);
if (c->dispatch_width == 16) {
@@ -1009,11 +1006,11 @@ void emit_math2(struct brw_wm_compile *c,
brw_MOV(p, brw_message_reg(5), sechalf(arg1[0]));
}
brw_set_saturate(p, (mask & SATURATE) ? 1 : 0);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p,
dst[dst_chan],
function,
saturate,
2,
arg0[0],
BRW_MATH_DATA_VECTOR,
@@ -1026,7 +1023,6 @@ void emit_math2(struct brw_wm_compile *c,
brw_math(p,
offset(dst[dst_chan],1),
function,
saturate,
4,
sechalf(arg0[0]),
BRW_MATH_DATA_VECTOR,
@@ -1739,11 +1735,11 @@ void brw_wm_emit( struct brw_wm_compile *c )
break;
case OPCODE_DDX:
emit_ddxy(p, dst, dst_flags, true, args[0]);
emit_ddxy(p, dst, dst_flags, true, args[0], false);
break;
case OPCODE_DDY:
emit_ddxy(p, dst, dst_flags, false, args[0]);
emit_ddxy(p, dst, dst_flags, false, args[0], c->key.render_to_fbo);
break;
case OPCODE_DP2:

View File

@@ -428,7 +428,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
[MESA_FORMAT_SIGNED_R16] = BRW_SURFACEFORMAT_R16_SNORM,
[MESA_FORMAT_SIGNED_GR1616] = BRW_SURFACEFORMAT_R16G16_SNORM,
[MESA_FORMAT_SIGNED_RGB_16] = 0,
[MESA_FORMAT_SIGNED_RGBA_16] = 0,
[MESA_FORMAT_SIGNED_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_SNORM,
[MESA_FORMAT_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_UNORM,
[MESA_FORMAT_RED_RGTC1] = BRW_SURFACEFORMAT_BC4_UNORM,
@@ -583,6 +583,9 @@ translate_tex_format(gl_format mesa_format,
GLenum depth_mode,
GLenum srgb_decode)
{
if (srgb_decode == GL_SKIP_DECODE_EXT)
mesa_format = _mesa_get_srgb_format_linear(mesa_format);
switch( mesa_format ) {
case MESA_FORMAT_Z16:
@@ -598,14 +601,6 @@ translate_tex_format(gl_format mesa_format,
case MESA_FORMAT_Z32_FLOAT_X24S8:
return BRW_SURFACEFORMAT_R32G32_FLOAT;
case MESA_FORMAT_SARGB8:
case MESA_FORMAT_SLA8:
case MESA_FORMAT_SL8:
if (srgb_decode == GL_DECODE_EXT)
return brw_format_for_mesa_format(mesa_format);
else if (srgb_decode == GL_SKIP_DECODE_EXT)
return brw_format_for_mesa_format(_mesa_get_srgb_format_linear(mesa_format));
case MESA_FORMAT_RGBA8888_REV:
/* This format is not renderable? */
return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;

View File

@@ -489,6 +489,24 @@ gen6_hiz_exec(struct intel_context *intel,
offset = intel_renderbuffer_tile_offsets(&rb, &tile_x, &tile_y);
}
/* According to the Sandy Bridge PRM, volume 2 part 1, pp326-327
* (3DSTATE_DEPTH_BUFFER dw5), in the documentation for "Depth
* Coordinate Offset X/Y":
*
* "The 3 LSBs of both offsets must be zero to ensure correct
* alignment"
*
* We have no guarantee that tile_x and tile_y are correctly aligned,
* since they are determined by the mipmap layout, which is only aligned
* to multiples of 4.
*
* So, to avoid hanging the GPU, just smash the low order 3 bits of
* tile_x and tile_y to 0. This is a temporary workaround until we come
* up with a better solution.
*/
tile_x &= ~7;
tile_y &= ~7;
uint32_t format;
switch (mt->format) {
case MESA_FORMAT_Z16: format = BRW_DEPTHFORMAT_D16_UNORM; break;

View File

@@ -29,13 +29,14 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
#include "main/fbobject.h"
static void
gen6_upload_scissor_state(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
struct gen6_scissor_rect *scissor;
uint32_t scissor_state_offset;

View File

@@ -30,6 +30,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
#include "main/fbobject.h"
#include "intel_batchbuffer.h"
/**
@@ -123,7 +124,7 @@ upload_sf_state(struct brw_context *brw)
uint32_t dw1, dw2, dw3, dw4, dw16, dw17;
int i;
/* _NEW_BUFFER */
bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
int attr = 0, input_index = 0;
int urb_entry_read_offset = 1;
float point_size;

View File

@@ -29,6 +29,7 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
#include "main/fbobject.h"
/* The clip VP defines the guardband region where expensive clipping is skipped
* and fragments are allowed to be generated and clipped out cheaply by the SF.
@@ -70,7 +71,7 @@ gen6_upload_sf_vp(struct brw_context *brw)
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,

View File

@@ -26,6 +26,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "intel_batchbuffer.h"
#include "main/fbobject.h"
static void
upload_clip_state(struct brw_context *brw)
@@ -40,7 +41,7 @@ upload_clip_state(struct brw_context *brw)
const struct gl_fragment_program *fprog = brw->fragment_program;
/* _NEW_BUFFERS */
bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
if (brw_fprog_uses_noperspective(fprog)) {
nonperspective_barycentric_enable_flag =

View File

@@ -349,6 +349,24 @@ gen7_hiz_exec(struct intel_context *intel,
offset = intel_renderbuffer_tile_offsets(&rb, &tile_x, &tile_y);
}
/* According to the Sandy Bridge PRM, volume 2 part 1, pp326-327
* (3DSTATE_DEPTH_BUFFER dw5), in the documentation for "Depth
* Coordinate Offset X/Y":
*
* "The 3 LSBs of both offsets must be zero to ensure correct
* alignment"
*
* We have no guarantee that tile_x and tile_y are correctly aligned,
* since they are determined by the mipmap layout, which is only aligned
* to multiples of 4.
*
* So, to avoid hanging the GPU, just smash the low order 3 bits of
* tile_x and tile_y to 0. This is a temporary workaround until we come
* up with a better solution.
*/
tile_x &= ~7;
tile_y &= ~7;
intel_emit_depth_stall_flushes(intel);
BEGIN_BATCH(7);

View File

@@ -93,6 +93,24 @@ static void emit_depthbuffer(struct brw_context *brw)
offset = intel_renderbuffer_tile_offsets(drb, &tile_x, &tile_y);
/* According to the Sandy Bridge PRM, volume 2 part 1, pp326-327
* (3DSTATE_DEPTH_BUFFER dw5), in the documentation for "Depth
* Coordinate Offset X/Y":
*
* "The 3 LSBs of both offsets must be zero to ensure correct
* alignment"
*
* We have no guarantee that tile_x and tile_y are correctly aligned,
* since they are determined by the mipmap layout, which is only aligned
* to multiples of 4.
*
* So, to avoid hanging the GPU, just smash the low order 3 bits of
* tile_x and tile_y to 0. This is a temporary workaround until we come
* up with a better solution.
*/
tile_x &= ~7;
tile_y &= ~7;
assert(region->tiling == I915_TILING_Y);
/* _NEW_DEPTH, _NEW_STENCIL */

View File

@@ -26,6 +26,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
#include "main/fbobject.h"
#include "intel_batchbuffer.h"
static void
@@ -49,7 +50,7 @@ upload_sbe_state(struct brw_context *brw)
bool userclip_active = (ctx->Transform.ClipPlanesEnabled != 0);
uint16_t attr_overrides[FRAG_ATTRIB_MAX];
/* _NEW_BUFFERS */
bool render_to_fbo = ctx->DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
uint32_t point_sprite_origin;
brw_compute_vue_map(&vue_map, intel, userclip_active, vs_outputs_written);
@@ -163,7 +164,7 @@ upload_sf_state(struct brw_context *brw)
uint32_t dw1, dw2, dw3;
float point_size;
/* _NEW_BUFFERS */
bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
dw1 = GEN6_SF_STATISTICS_ENABLE |
GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;

View File

@@ -25,6 +25,7 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
#include "main/fbobject.h"
static void
gen7_upload_sf_clip_viewport(struct brw_context *brw)
@@ -33,7 +34,7 @@ gen7_upload_sf_clip_viewport(struct brw_context *brw)
struct gl_context *ctx = &intel->ctx;
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat y_scale, y_bias;
const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
struct gen7_sf_clip_viewport *vp;

View File

@@ -192,6 +192,9 @@ _intel_batchbuffer_flush(struct intel_context *intel,
intel->batch.reserved_space = 0;
if (intel->vtbl.finish_batch)
intel->vtbl.finish_batch(intel);
/* Mark the end of the buffer. */
intel_batchbuffer_emit_dword(intel, MI_BATCH_BUFFER_END);
if (intel->batch.used & 1) {
@@ -199,9 +202,6 @@ _intel_batchbuffer_flush(struct intel_context *intel,
intel_batchbuffer_emit_dword(intel, MI_NOOP);
}
if (intel->vtbl.finish_batch)
intel->vtbl.finish_batch(intel);
intel_upload_finish(intel);
/* Check that we didn't just wrap our batchbuffer at a bad time. */

View File

@@ -30,6 +30,7 @@
#include "intel_fbo.h"
#include "intel_mipmap_tree.h"
#include "main/fbobject.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@@ -82,7 +83,7 @@ intel_check_front_buffer_rendering(struct intel_context *intel)
static void
intelDrawBuffer(struct gl_context * ctx, GLenum mode)
{
if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_rendering =
intel->is_front_buffer_rendering;
@@ -105,7 +106,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
static void
intelReadBuffer(struct gl_context * ctx, GLenum mode)
{
if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_reading =
intel->is_front_buffer_reading;

View File

@@ -206,7 +206,7 @@ intel_flush_front(struct gl_context *ctx)
__DRIcontext *driContext = intel->driContext;
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) {
if (screen->dri2.loader &&
(screen->dri2.loader->base.version >= 2)
&& (screen->dri2.loader->flushFrontBuffer != NULL) &&
@@ -445,7 +445,7 @@ intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
if (intel->saved_viewport)
intel->saved_viewport(ctx, x, y, w, h);
if (ctx->DrawBuffer->Name == 0) {
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
dri2InvalidateDrawable(driContext->driDrawablePriv);
dri2InvalidateDrawable(driContext->driReadablePriv);
}

View File

@@ -29,6 +29,7 @@
#include "main/enums.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/fbobject.h"
#include "main/image.h"
#include "main/bufferobj.h"
#include "main/readpix.h"
@@ -116,7 +117,7 @@ do_blit_readpixels(struct gl_context * ctx,
return false;
}
else {
if (ctx->ReadBuffer->Name == 0)
if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
rowLength = -rowLength;
}
@@ -145,7 +146,7 @@ do_blit_readpixels(struct gl_context * ctx,
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
if (ctx->ReadBuffer->Name == 0)
if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
y = ctx->ReadBuffer->Height - (y + height);
if (!intelEmitCopyBlit(intel,

View File

@@ -556,10 +556,10 @@ intelCreateContext(gl_api api,
if (ctx->VersionMajor > major_version
|| (ctx->VersionMajor == major_version
&& ctx->VersionMinor >= minor_version)) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
return true;
}
*error = __DRI_CTX_ERROR_BAD_VERSION;
intelDestroyContext(driContextPriv);
} else {
*error = __DRI_CTX_ERROR_NO_MEMORY;

View File

@@ -66,6 +66,8 @@ radeon_renderbuffer_map(struct gl_context *ctx, struct gl_renderbuffer *rb)
rrb->base.Map = map;
rrb->base.RowStride = stride;
/* No floating point color buffers, use GLubytes */
rrb->base.ColorType = GL_UNSIGNED_BYTE;
}
static void

View File

@@ -446,14 +446,43 @@ xmesa_MapRenderbuffer(struct gl_context *ctx,
}
else {
/* this must be a pixmap/window renderbuffer */
int (*old_handler)(XMesaDisplay *, XErrorEvent *);
int y2 = rb->Height - y - h;
assert(xrb->pixmap);
/* Install error handler for XGetImage() in case the the window
* isn't mapped. If we fail we'll create a temporary XImage.
*/
mesaXErrorFlag = 0;
old_handler = XSetErrorHandler(mesaHandleXError);
/* read pixel data out of the pixmap/window into an XImage */
ximage = XGetImage(xrb->Parent->display,
xrb->pixmap, x, y2, w, h,
AllPlanes, ZPixmap);
XSetErrorHandler(old_handler);
if (mesaXErrorFlag) {
/* create new, temporary XImage */
int bytes_per_line =
_mesa_format_row_stride(xrb->Base.Base.Format,
xrb->Base.Base.Width);
char *image = (char *) malloc(bytes_per_line *
xrb->Base.Base.Height);
ximage = XCreateImage(xrb->Parent->display,
xrb->Parent->xm_visual->visinfo->visual,
xrb->Parent->xm_visual->visinfo->depth,
ZPixmap, /* format */
0, /* offset */
image, /* data */
xrb->Base.Base.Width,
xrb->Base.Base.Height,
8, /* pad */
bytes_per_line);
}
if (!ximage) {
*mapOut = NULL;
*rowStrideOut = 0;

View File

@@ -440,10 +440,6 @@
</desc>
</desc>
<desc name="border" error="GL_INVALID_VALUE">
<value name="0"/>
</desc>
<desc name="format">
<value name="GL_ALPHA"/>
@@ -1918,10 +1914,6 @@
<value name="GL_LUMINANCE"/>
<value name="GL_LUMINANCE_ALPHA"/>
</desc>
<desc name="border" error="GL_INVALID_VALUE">
<value name="0"/>
</desc>
</template>
<template name="CopyTexSubImage2D">

View File

@@ -135,6 +135,9 @@ struct gl_enable_attrib
/* GL_ARB_point_sprite / GL_NV_point_sprite */
GLboolean PointSprite;
GLboolean FragmentShaderATI;
/* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
GLboolean sRGBEnabled;
};
@@ -322,6 +325,9 @@ _mesa_PushAttrib(GLbitfield mask)
attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
save_attrib_data(&head, GL_ENABLE_BIT, attr);
/* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
attr->sRGBEnabled = ctx->Color.sRGBEnabled;
}
if (mask & GL_EVAL_BIT) {
@@ -617,6 +623,10 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
enable->VertexProgramTwoSide,
GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
/* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
TEST_AND_UPDATE(ctx->Color.sRGBEnabled, enable->sRGBEnabled,
GL_FRAMEBUFFER_SRGB);
/* texture unit enables */
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
const GLbitfield enabled = enable->Texture[i];
@@ -799,6 +809,14 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
_mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
samp->CompareFailValue);
}
if (ctx->Extensions.ARB_shadow) {
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
samp->CompareMode);
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC,
samp->CompareFunc);
}
if (ctx->Extensions.ARB_depth_texture)
_mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
}
/* remove saved references to the texture objects */
@@ -973,6 +991,9 @@ _mesa_PopAttrib(void)
_mesa_set_enable(ctx, GL_DITHER, color->DitherFlag);
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, color->ClampFragmentColor);
_mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
/* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color->sRGBEnabled);
}
break;
case GL_CURRENT_BIT:

View File

@@ -42,6 +42,7 @@
#include "mfeatures.h"
#include "mtypes.h"
#include "texobj.h"
#include "transformfeedback.h"
/* Debug flags */
@@ -524,7 +525,7 @@ _mesa_copy_buffer_subdata(struct gl_context *ctx,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size)
{
void *srcPtr, *dstPtr;
GLubyte *srcPtr, *dstPtr;
/* the buffers should not be mapped */
assert(!_mesa_bufferobj_mapped(src));
@@ -791,6 +792,24 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
}
/* unbind ARB_copy_buffer binding points */
if (ctx->CopyReadBuffer == bufObj) {
_mesa_BindBufferARB( GL_COPY_READ_BUFFER, 0 );
}
if (ctx->CopyWriteBuffer == bufObj) {
_mesa_BindBufferARB( GL_COPY_WRITE_BUFFER, 0 );
}
/* unbind transform feedback binding points */
if (ctx->TransformFeedback.CurrentBuffer == bufObj) {
_mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 );
}
for (j = 0; j < MAX_FEEDBACK_ATTRIBS; j++) {
if (ctx->TransformFeedback.CurrentObject->Buffers[j] == bufObj) {
_mesa_BindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, j, 0 );
}
}
/* unbind any pixel pack/unpack pointers bound to this buffer */
if (ctx->Pack.BufferObj == bufObj) {
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );
@@ -1311,6 +1330,12 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
return;
}
if (size < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glCopyBufferSubData(writeOffset = %d)", (int) size);
return;
}
if (readOffset + size > src->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glCopyBuffserSubData(readOffset + size = %d)",

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