José Fonseca [Fri, 21 Jun 2013 10:08:56 +0000 (11:08 +0100)]
tools/trace: Do a better job at comparing multi line strings.
For TGSI diffing.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 20 Jun 2013 18:40:47 +0000 (19:40 +0100)]
tools/trace: Tool to compare json state dumps.
Copied verbatim from apitrace's scripts/jsondiff.py
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 20 Jun 2013 18:40:06 +0000 (19:40 +0100)]
tools/trace: Tool to dump gallium state at any draw call.
Based from the code from the good old python state tracker.
Extremely handy to diagnose regressions in state trackers.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 20 Jun 2013 18:38:55 +0000 (19:38 +0100)]
tools/trace: Defer blob hex-decoding.
To speed up parsing.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 20 Jun 2013 18:37:31 +0000 (19:37 +0100)]
trace: Don't dump texture transfers.
Huge trace files with little value.
Reviewed-by: Brian Paul <brianp@vmware.com>
Chia-I Wu [Thu, 20 Jun 2013 03:38:28 +0000 (11:38 +0800)]
ilo: replace a boolean by bool
bool is used internally. This is just cosmetic.
Chia-I Wu [Thu, 20 Jun 2013 03:36:36 +0000 (11:36 +0800)]
ilo: rename cache_seqno to uploaded
It has been used as a bool since shader cache rework.
Roland Scheidegger [Wed, 19 Jun 2013 21:46:15 +0000 (23:46 +0200)]
util: (trivial) add has_popcnt field
Not used yet but there's a couple of places in llvmpipe which should use this
(occlusion count is currently very inefficent if there's no cpu popcnt
instruction).
Roland Scheidegger [Wed, 19 Jun 2013 21:42:28 +0000 (23:42 +0200)]
llvmpipe: use 64bit counter for occlusion queries
Some APIs require 64bit and at least for 64bit archs the overhead
should be minimal.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Wed, 19 Jun 2013 21:38:39 +0000 (23:38 +0200)]
llvmpipe: handle more queries
Handle PIPE_QUERY_GPU_FINISHED and PIPE_QUERY_TIMESTAMP_DISJOINT, and
also fill out the ps_invocations and c_primitives from the
PIPE_QUERY_PIPELINE_STATISTICS (the others in there should already
be handled). Note that ps_invocations isn't pixel exact, just 16 pixel
exact but I guess it's better than nothing.
Doesn't really seem to work correctly but there's probably bugs elsewhere.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 18 Jun 2013 21:27:31 +0000 (23:27 +0200)]
softpipe: handle all queries, and change for the new disjoint semantics
The driver can do render_condition but wasn't handling the occlusion
and so_overflow predicates (though the latter might not work yet due
to gs support).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Wed, 19 Jun 2013 21:25:39 +0000 (23:25 +0200)]
gallium: fix PIPE_QUERY_TIMESTAMP_DISJOINT
The semantics didn't really make sense, not really matching neither d3d9
(though the docs are all broken there) nor d3d10. So make it match d3d10
semantics, which actually gives meaning to the "disjoint" part.
Drivers are fixed up in a very primitive way, I have no idea what could
actually cause the counter to become unreliable so just always return
FALSE for the disjoint part.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
José Fonseca [Mon, 10 Jun 2013 08:47:00 +0000 (09:47 +0100)]
trace: Dump pipe_rasterizer_state::clip_halfz.
Trivial.
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
svga: add some comments about primitive conversion
And clean up the svga_translate_prim() function with better
variable names.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
indices: add some comments
This is pretty complicated code with few/any comments. Here's a first stab.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
svga: reindent svga_tgsi.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
svga: whitespace, comment, formatting fixes in svga_tgsi_emit.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
svga: move some svga/tgsi functions
Move some functions from the svga_tgsi_insn.h header into the
svga_tgsi_insn.c file since they're only used there. Plus, add
comments and fix formatting.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
svga: formatting fixes in svga_tgsi_insn.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
mesa: wrap comments, code to 78 columns in multisample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 19 Jun 2013 16:39:43 +0000 (10:39 -0600)]
mesa: remove unused BITSET64 macros
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Maarten Lankhorst [Wed, 19 Jun 2013 11:08:51 +0000 (13:08 +0200)]
nvc0: kill assert in ppp code
It's no longer always true, and the video tilign aligment should
ensure the alignment is handled correctly regardless.
Chia-I Wu [Wed, 19 Jun 2013 01:56:05 +0000 (09:56 +0800)]
ilo: rework shader cache
The new code makes the shader cache manages all shaders and be able to upload
all of them to a caller-provided bo as a whole.
Previously, we uploaded only the bound shaders. When a different set of
shaders is bound, we had to allocate a new kernel bo to upload if the current
one is busy.
Emil Velikov [Tue, 18 Jun 2013 22:02:24 +0000 (00:02 +0200)]
nv50: avoid crash on updating RASTERIZE_ENABLE state
When doing blit using the 3D engine, the rasterizer cso may be NULL.
Ported from nvc0 commit
8aa8b0539.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Kristian Høgsberg [Tue, 18 Jun 2013 20:53:46 +0000 (16:53 -0400)]
wayland: Handle global_remove event as well
We need to set up a handler for the global_remove event that gets sent
out when a global gets removed. Without the handler we end up calling
a NULL pointer.
https://bugs.freedesktop.org/show_bug.cgi?id=65910
NOTE: This is a candidate for the stable branches.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Jordan Justen [Mon, 17 Jun 2013 21:05:21 +0000 (14:05 -0700)]
gen7: fix GPU hang on WebGL texture-size test
When rendering to a texture with BaseLevel set, the miptree may be laid
out such that BaseLevel is in level 0 of the miptree (to avoid wasting
memory on unused levels between 0 and BaseLevel-1). In that case, we
have to shift our render target's level down to the appropriate level of
the smaller miptree.
The WebGL test in combination with a meta code relating to
glGenerateMipmap also triggered a similar failure scenario.
This GPU hang regression was introduced by
c754f7a8.
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=65324
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Eric Anholt [Tue, 11 Jun 2013 22:59:07 +0000 (15:59 -0700)]
intel: Remove unused IS_POWER_OF_TWO() macro.
The is_power_of_two() inline function has been used instead.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Zack Rusin [Tue, 18 Jun 2013 01:06:11 +0000 (21:06 -0400)]
Revert "draw: clear the draw buffers in draw"
This reverts commit
41966fdb3b71c0b70aeb095e0eb3c5626c144a3a.
While it's a lot cleaner it causes regressions because
the draw interface is always called from the draw functions
of the drivers (because the buffers need to be mapped) which
means that the stream output buffers endup being cleared on
every draw rather than on setting.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Roland Scheidegger [Mon, 17 Jun 2013 22:42:31 +0000 (00:42 +0200)]
llvmpipe: fixes for conditional rendering
honor render_condition for clear_render_target and clear_depth_stencil.
Also add minimal support for occlusion predicate, though it can't be active
at the same time as an occlusion query yet.
While here also switchify some large if-else (actually just mutually
exclusive if-if-if...) constructs.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Fri, 14 Jun 2013 17:48:57 +0000 (19:48 +0200)]
gallium: add condition parameter to render_condition
For conditional rendering this makes it possible to skip rendering
if either the predicate is true or false, as supported by d3d10
(in fact previously it was sort of implied skip rendering if predicate
is false for occlusion predicate, and true for so_overflow predicate).
There's no cap bit for this as presumably all drivers could do it trivially
(but this patch does not implement it for the drivers using true
hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL
functionality).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Chia-I Wu [Tue, 18 Jun 2013 04:33:15 +0000 (12:33 +0800)]
ilo: construct depth/stencil command in create_surface()
Add ilo_gpe_init_zs_surface() to construct
3DSTATE_DEPTH_BUFFER
3DSTATE_STENCIL_BUFFER
3DSTATE_HIER_DEPTH_BUFFER
at surface creation time. This allows fast state emission in draw_vbo().
Eric Anholt [Tue, 4 Jun 2013 17:35:26 +0000 (10:35 -0700)]
intel: Allow blorp CopyTexSubImage to nonzero destination slices.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Eric Anholt [Mon, 3 Jun 2013 22:57:23 +0000 (15:57 -0700)]
intel: Allow blit CopyTexSubImage to nonzero destination slices.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Eric Anholt [Tue, 4 Jun 2013 03:50:50 +0000 (20:50 -0700)]
intel: Directly implement blit glBlitFramebuffer instead of awkward reuse.
This gets us support for blitting to attachment types other than
textures.
v2: fix up comments from review by Kenneth.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Eric Anholt [Tue, 4 Jun 2013 05:55:39 +0000 (22:55 -0700)]
intel: Move XRGB->ARGB blit logic into intel_miptree_blit().
Now any caller (such as glCopyPixels()) can benefit from it, and it only
changes the correct subset of the destination instead of a whole teximage.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Eric Anholt [Tue, 4 Jun 2013 05:40:26 +0000 (22:40 -0700)]
intel: Fix Y tiling support for glCopyTexSubImage's alpha override.
Apparently we don't have any piglit tests for this, because it would have
assertion failed in a debug build, or just rendered wrong in a non-debug
build if the destination wasn't covering whole tiles.
v2: Use the new macros.
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Eric Anholt [Mon, 3 Jun 2013 23:49:40 +0000 (16:49 -0700)]
intel: Make batch macros for doing BCS_SWCTRL setup.
We're going to add more BCS_SWCTRL setup instances soon, and you have to
be careful to have the set and restore atomic with the rendering that's
done, so that our state doesn't leak out to other rendering processes.
v2: Rewrite the patch to have batch begin/advance macros so that magic
numbers don't get sprinkled around (and so you don't mix up your
do-I-need-to-reset vs what-do-I-reset-to logic, which I nearly did in
the next patch when first writing it)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Mon, 3 Jun 2013 22:12:49 +0000 (15:12 -0700)]
mesa: Hide weirdness of 1D_ARRAY textures from Driver.CopyTexSubImage().
Intel had brokenness here, and I'd like to continue moving Mesa toward
hiding 1D_ARRAY's ridiculousness inside of the core, like we did with
MapTextureImage. Fixes copyteximage 1D_ARRAY on intel.
There's still an impedance mismatch in meta when falling back to read and
texsubimage, since texsubimage expects coordinates into 1D_ARRAY as
(width, slice, 0) instead of (width, 0, slice).
v2: Fix offset of scanline reads from the source. (Thanks Brian!), replace
dd.h comment with Paul's text and replace early exit with an assert.
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Dave Airlie [Sun, 16 Jun 2013 11:24:00 +0000 (21:24 +1000)]
tgsi: text parser: fix parsing of array in declaration
I noticed this code didn't work as advertised while doing some passing around
of TGSI shaders and trying to reparse them, and things failing.
This seems to fix it here for at least the small test case I hacked into a
graw test.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Sven Joachim [Fri, 14 Jun 2013 20:10:33 +0000 (22:10 +0200)]
mesa: Fix ieee fp on Alpha
Commit
1f82bf12ed inadvertently broke it, checking for __IEEE_FLOAT on all
Alpha machines instead of only on VMS as before.
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Sven Joachim <svenjoac@gmx.de>
Richard Sandiford [Mon, 17 Jun 2013 16:13:25 +0000 (12:13 -0400)]
st/xlib: Fix XImage stride calculation
Fixes window skew seen while running gnome on a 16-bit screen over vnc.
NOTE: This is a candidate for stable release branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Richard Sandiford [Mon, 17 Jun 2013 16:10:49 +0000 (12:10 -0400)]
st/xlib Fix XIMage bytes-per-pixel calculation
Fixes a crash seen while running gnome on a 16-bit screen over vnc.
NOTE: This is a candidate for stable release branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Jonathan Gray [Sun, 16 Jun 2013 15:11:01 +0000 (01:11 +1000)]
gallium: replace bswap_32 calls with util_bswap32
byteswap.h and bswap_32 aren't portable, replace them with calls to
gallium's util_bswap32 as suggested by Mark Kettenis. Lets these files
build on OpenBSD.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Zack Rusin [Thu, 13 Jun 2013 17:34:57 +0000 (13:34 -0400)]
draw: fix a regression in computing max elt
gl can use elts without setting indices, in which case
our eltMax was set to 0 and always invoking the overflow
condition. So by default set eltMax to maximum, it will
be curbed by draw_set_indexes (if it ever comes) and if
not then it will let gl's glVertexPointer/glDrawArrays
work correctly. Fixes piglit's
triangle-rasterization-overdraw test.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Zack Rusin [Thu, 13 Jun 2013 21:57:47 +0000 (17:57 -0400)]
draw: clear the draw buffers in draw
Moves clearing of the draw so target buffers to the draw
module. They had to be cleared in the drivers before
which was quite messy.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Chia-I Wu [Mon, 17 Jun 2013 06:17:10 +0000 (14:17 +0800)]
ilo: add pipe-based copy method to ilo_blitter
It enables accelerated resource_copy_region() when blt-based method fails.
Chia-I Wu [Mon, 17 Jun 2013 05:59:51 +0000 (13:59 +0800)]
ilo: add BLT-based blitting methods to ilo_blitter
Port BLT code in ilo_blit.c to BLT-based blitting methods of ilo_blitter. Add
BLT-based clears. The latter is verifed with util_clear(), but it is not in
use yet.
Chia-I Wu [Mon, 17 Jun 2013 04:24:17 +0000 (12:24 +0800)]
ilo: replace util_blitter by ilo_blitter
ilo_blitter is just a wrapper for util_blitter for now. We will port BLT code
to ilo_blitter shortly.
Kenneth Graunke [Sat, 26 Jan 2013 10:06:08 +0000 (02:06 -0800)]
i965: Assume flexible hardware primitive restart exists in the future.
Primitive restart with an arbitrary cut index was first supported as of
Haswell. It's very doubtful that they'd take that away in future
hardware, so we may as well alter the check now.
Chris Forbes [Fri, 7 Jun 2013 18:11:44 +0000 (06:11 +1200)]
i965: Shrink Gen5 VUE map layout to be the same as Gen4.
The PRM suggests a larger layout, mostly to support having
gl_ClipDistance[] somewhere predictable for the fixed-function clipper
-- but it didn't actually arrive in Gen5.
Just use the same layout for both Gen4 and Gen5.
No Piglit regressions.
Improves performance in CS:S Video Stress Test by ~3%.
V2: - Remove now-useless function for determining the SF URB read offset
- Remove now-unused BRW_VARYING_SLOT_POS_DUPLICATE
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Sat, 30 Mar 2013 07:15:54 +0000 (00:15 -0700)]
i965: Implement 16-wide math on G45 and Ironlake.
[chrisf:]
Improves performance in CS:S video stress test by about 2%.
No piglit regressions on Ironlake.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Matt Turner [Wed, 22 May 2013 21:57:04 +0000 (14:57 -0700)]
glsl: Disallow return with a void argument from void functions.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 22 May 2013 19:14:32 +0000 (12:14 -0700)]
glsl: Allow implicit conversion of return values.
Required by ARB_shading_language_420pack.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 22 May 2013 17:56:25 +0000 (10:56 -0700)]
glsl: Add gl_{Max,Min}ProgramTexelOffset built-in constants.
Required by ARB_shading_language_420pack. Note that the 420pack spec
incorrectly specifies their values as (Min, Max) = (-7, 8) when they
should be (-8, 7) as listed in the GLSL 4.30 and ESSL 3.0 specs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Mon, 20 May 2013 18:01:37 +0000 (11:01 -0700)]
glsl: Allow swizzles on scalars.
Required by ARB_shading_language_420pack.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Mon, 20 May 2013 16:18:01 +0000 (09:18 -0700)]
glsl: Allow .length() method on vectors and matrices.
Required by ARB_shading_language_420pack.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Todd Previte [Mon, 20 May 2013 15:41:18 +0000 (08:41 -0700)]
mesa: Add infrastructure for ARB_shading_language_420pack.
v2 [mattst88]
- Split infrastructure into separate patch.
- Add preprocessor #define.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chia-I Wu [Fri, 14 Jun 2013 16:56:17 +0000 (00:56 +0800)]
ilo: fix for half-float vertex arrays
Commit
6fe0453c339b6e894e0ee8d2200e7638a43ed21e broke half-float vertex
arrays. This reverts a part of that commit, and explains why.
Chia-I Wu [Fri, 14 Jun 2013 07:35:36 +0000 (15:35 +0800)]
ilo: add some assertions to help debugging
Assert that we do not support user vertex/index/constant buffers. Issue a
warning when a sampler view is created for a resource without
PIPE_BIND_SAMPLER_VIEW.
Chia-I Wu [Fri, 14 Jun 2013 07:26:07 +0000 (15:26 +0800)]
ilo: silence a compiler warning
The path should never be hit.
Vinson Lee [Fri, 7 Jun 2013 06:07:30 +0000 (23:07 -0700)]
glsl: Fix null check in read_dereference.
Fixes "Logically dead code" defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Chia-I Wu [Thu, 13 Jun 2013 05:18:15 +0000 (13:18 +0800)]
st/mesa: fix temp texture bindings in st_CopyPixels()
The temporary texture should have either PIPE_BIND_RENDER_TARGET or
PIPE_BIND_DEPTH_STENCIL set in addition to PIPE_BIND_SAMPLER_VIEW.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Zack Rusin [Tue, 11 Jun 2013 03:36:59 +0000 (23:36 -0400)]
gallium/draw: add limits to the clip and cull distances
There are strict limits on those registers. Define the maximums
and use them instead of magic numbers. Also allows us to add
some extra sanity checks.
Suggested by Brian.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Zack Rusin [Tue, 11 Jun 2013 02:59:33 +0000 (22:59 -0400)]
draw: cleanup the distance culling code a bit
We don't need the clamped variable, because we can just
return early. We should also do the regular culling after
the distance culling passes.
All spotted by Brian.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Chia-I Wu [Thu, 13 Jun 2013 10:22:40 +0000 (18:22 +0800)]
ilo: mapping a resource may make some states dirty
When a resource is busy and is mapped with
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE, the underlying bo is replaced. We need
to mark states affected by the resource dirty.
With this change, we no longer have to emit vertex buffers and index buffer
unconditionally.
Chia-I Wu [Thu, 13 Jun 2013 09:48:00 +0000 (17:48 +0800)]
ilo: bump up PIPE_CAP_GLSL_FEATURE_LEVEL to 140
With UBO and TBO support, we are supposedly good to claim GLSL 1.40.
Chia-I Wu [Thu, 13 Jun 2013 09:46:58 +0000 (17:46 +0800)]
ilo: initialize dirty flags in ilo_init_states()
Now that we have a function to initialize states, initialize dirty flags there
too.
Chia-I Wu [Thu, 13 Jun 2013 02:10:17 +0000 (10:10 +0800)]
ilo: re-emit states that involve resources
Even with hardware contexts, since we do not pin resources, we have to re-emit
the states so that the resources are referenced (by cp->bo) and their offsets
are updated in case they are moved. This also allows us to elimiate cp flush
in is_bo_busy().
Chia-I Wu [Thu, 13 Jun 2013 04:57:07 +0000 (12:57 +0800)]
ilo: fix for util_blitter_clear() changes
It has been broken since
17350ea979b883662573dac136cd9efb49938210.
Manfred Ernst [Thu, 13 Jun 2013 03:03:02 +0000 (20:03 -0700)]
mesa: Fix bug in unclamped float to ubyte conversion.
Problem: The IEEE float optimized version of UNCLAMPED_FLOAT_TO_UBYTE
in macros.h computed incorrect results for inputs in the range
0x3f7f0000 (=0.
99609375) to 0x3f7f7f80 (=0.
99803924560546875)
inclusive. 0x3f7f7f80 is the IEEE float value that results in 254.5
when multiplied by 255. With rounding mode "round to closest even
integer", this is the largest float in the range 0.0-1.0 that is
converted to 254 by the generic implementation of
UNCLAMPED_FLOAT_TO_UBYTE. The IEEE float optimized version
incorrectly defined the cut-off for mapping to 255 as 0x3f7f0000
(=255.0/256.0). The same bug was present in the function
float_to_ubyte in u_math.h.
Fix: The proposed fix replaces the incorrect cut-off value by
0x3f800000, which is the IEEE float representation of 1.0f. 0x3f7f7f81
(or any value in between) would also work, but 1.0f is probably
cleaner.
The patch does not regress piglit on llvmpipe and on i965 on sandy
bridge.
Tested-by Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 1 Jun 2013 01:19:21 +0000 (03:19 +0200)]
st/dri: if flushing a drawable, don't set reason=SWAPBUFFERS
0 means SWAPBUFFERS.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 1 Jun 2013 01:18:04 +0000 (03:18 +0200)]
st/dri: resolve the back buffer only in SwapBuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 31 May 2013 20:48:48 +0000 (22:48 +0200)]
st/dri: manually swap MSAA front and back buffers in SwapBuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 31 May 2013 19:52:01 +0000 (21:52 +0200)]
st/dri: always copy new DRI front and back buffers to corresponding MSAA buffers
This commit fixes these piglit tests with an MSAA visual forced on:
- read-front
- glx-copy-sub-buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 31 May 2013 19:43:50 +0000 (21:43 +0200)]
st/dri: refactor dri_msaa_resolve
The generic blit will be used by the following commit.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 1 Jun 2013 00:04:56 +0000 (02:04 +0200)]
st/dri: reuse depth-stencil and MSAA resources after DRI2 invalidate event
Page flipping generates an invalidate event every frame, causing reallocations
of all private resources (MSAA and depth-stencil).
Reusing the resources may improve performance (especially under memory
pressure).
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 21:08:11 +0000 (23:08 +0200)]
st/dri: fix MSAA resolving of buffers with height > width
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 31 May 2013 18:26:39 +0000 (20:26 +0200)]
st/mesa: make generic CopyPixels path work with MSAA visuals
We have to use pipe->blit, not resource_copy_region, so that the read buffer
is resolved if it's multisampled. I also removed the CPU-based copying,
which just did format conversion (obsoleted by the blit).
Also, the layer/slice/face of the read buffer is taken into account (this was
ignored).
Last but not least, the format choosing is improved to take float and integer
read buffers into account.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 31 May 2013 13:13:46 +0000 (15:13 +0200)]
st/mesa: don't use blit_copy_pixels if an occlusion query is active
CopyPixels, just as DrawPixels, should count the samples that passed
depth test.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 30 May 2013 19:34:06 +0000 (21:34 +0200)]
st/mesa: rework blit_copy_pixels to use pipe->blit
There were 2 issues with it:
- resource_copy_region doesn't allow different sample counts of both src
and dst, which can occur if we blit between a window and a FBO, and
the window has an MSAA colorbuffer and the FBO doesn't.
(this was the main motivation for using pipe->blit)
- blitting from or to a non-zero layer/slice/face was broken, because
rtt_face and rtt_slice were ignored.
blit_copy_pixels is now used even if the formats and orientation of
framebuffers don't match.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 18:12:27 +0000 (20:12 +0200)]
r600g: upsample and downsample MSAA resources for transfers
We did downsample (=resolve) MSAA resources to make ReadPixels work with MSAA
GLX visuals, which was enough for read-only color-only transfers.
This commit makes write color transfers and depth-stencil transfers work
in a similar manner. It does downsampling in transfer_map and upsampling
in transfer_unmap.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 17:26:56 +0000 (19:26 +0200)]
gallium/u_format: add a new helper for initializing pipe_blit_info::mask
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 13:51:20 +0000 (15:51 +0200)]
gallium/u_blitter: make clearing independent of the colorbuffer format
There isn't any difference between 32_FLOAT and 32_*INT in vertex fetching.
Both of them don't do any format conversion.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 13:35:38 +0000 (15:35 +0200)]
gallium/u_blitter: make clearing independent of the number of bound colorbuffers
We can use the fragment shader TGSI property WRITES_ALL_CBUFS.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 12:11:58 +0000 (14:11 +0200)]
gallium/util: make WRITES_ALL_CBUFS optional in the passthrough fragment shader
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 29 May 2013 15:32:44 +0000 (17:32 +0200)]
mesa: fix OES_EGL_image_external being partially allowed in the core profile
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Ian Romanick [Mon, 10 Jun 2013 17:39:28 +0000 (10:39 -0700)]
glsl: Generate smaller values for uniform locations
Previously we would generate uniform locations as (slot << 16) +
array_index. We do this to handle applications that assume the location
of a[2] will be +1 from the location of a[1]. This resulted in every
uniform location being at least 0x10000. The OpenGL 4.3 spec was
amended to require this behavior, but previous versions did not require
locations of array (or structure) members be sequential.
We've now encountered two applications that assume uniform values will
be "small." As far as we can tell, these applications store the GLint
returned by glGetUniformLocation in a int16_t or possibly an int8_t.
THIS BEHAVIOR IS NOT GUARANTEED OR IMPLIED BY ANY VERSION OF OpenGL.
Other implementations happen to have both these behaviors (sequential
array elements and small values) since OpenGL 2.0, so let's just match
their behavior.
Fixes "3D Bowling" on Android.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
Ian Romanick [Mon, 10 Jun 2013 17:35:05 +0000 (10:35 -0700)]
glsl: Add gl_shader_program::UniformLocationBaseScale
This is used by _mesa_uniform_merge_location_offset and
_mesa_uniform_split_location_offset to determine how the base and offset
are packed. Previously, this value was hard coded as (1U<<16) in those
functions via the shift and mask contained therein. The value is still
(1U<<16), but it can be changed in the future.
The next patch dynamically generates this value.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
Ian Romanick [Mon, 10 Jun 2013 17:33:59 +0000 (10:33 -0700)]
glsl: Add a gl_shader_program parameter to _mesa_uniform_{merge,split}_location_offset
This will be used in the next commit.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
Roland Scheidegger [Wed, 12 Jun 2013 22:40:34 +0000 (00:40 +0200)]
util: new util_fill_box helper
Use new util_fill_box helper for util_clear_render_target.
(Also fix off-by-one map error.)
v2: handle non-zero z correctly in new helper
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Wed, 12 Jun 2013 22:40:24 +0000 (00:40 +0200)]
gallivm: (trivial) remove duplicated code block (including comment)
Paul Berry [Tue, 21 May 2013 18:58:38 +0000 (11:58 -0700)]
i965/gen7: Enable support for fast color clears.
This patch adds code to place mcs_state into INTEL_MCS_STATE_RESOLVED
for miptrees that are capable of supporting fast color clears. This
will have no effect on buffers that don't undergo a fast color clear;
however, for buffers that do undergo a fast color clear, an MCS
miptree will be allocated (at the time of the first fast clear), and
will be used thereafter.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Tue, 21 May 2013 21:21:44 +0000 (14:21 -0700)]
i965/gen7+: Disable fast color clears on shared regions.
In certain circumstances the memory region underlying a miptree is
shared with other miptrees, or with other code outside Mesa's control.
This happens, for instance, when an extension like GL_OES_EGL_image or
GLX_EXT_texture_from_pixmap extension is used to associate a miptree
with an image existing outside of Mesa.
When this happens, we need to disable fast color clears on the miptree
in question, since there's no good synchronization mechanism to ensure
that deferred clear writes get performed by the time the buffer is
examined from the other miptree, or from outside of Mesa.
Fortunately, this should not be a performance hit for most
applications, since most applications that use these extensions use
them for importing textures into Mesa, rather than for exporting
rendered images out of Mesa. So most of the time the miptrees
involved will never experience a clear.
v2: Rework based on the fact that we have decided not to use an
accessor function to protect access to the region.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Tue, 7 May 2013 21:55:42 +0000 (14:55 -0700)]
i965/gen7+: Resolve color buffers when necessary.
Resolve color buffers that have been fast-color cleared:
1. before texturing from the buffer (brw_predraw_resolve_buffers())
2. before using the buffer as the source in a blorp blit
(brw_blorp_blit_miptrees())
3. before mapping the buffer's miptree (intel_miptree_map_raw(),
intel_texsubimage_tiled_memcpy())
4. before accessing the buffer using the hardware blitter
(intel_miptree_blit(), do_blit_bitmap())
v2: Rework based on the fact that we have decided not to use an
accessor function to protect access to the region.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Tue, 7 May 2013 22:38:45 +0000 (15:38 -0700)]
i965/gen7+: Ensure that front/back buffers are fast-clear resolved.
We already had code in intel_downsample_for_dri2_flush() for
downsampling front and back buffers when multisampling was in use.
This patch extends that function to perform fast color clear resolves
when necessary.
To account for the additional functionality, the function is renamed
to simply intel_resolve_for_dri2_flush().
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Mon, 6 May 2013 17:37:04 +0000 (10:37 -0700)]
i965/blorp: Write blorp code to do render target resolves.
This patch implements the "render target resolve" blorp operation.
This will be needed when a buffer that has experienced a fast color
clear is later used for a purpose other than as a render target
(texturing, glReadPixels, or swapped to the screen). It resolves any
remaining deferred clear operation that was not taken care of during
normal rendering.
Fortunately not much work is necessary; all we need to do is scale
down the size of the rectangle primitive being emitted, run the
fragment shader with the "Render Target Resolve Enable" bit set, and
ensure that the fragment shader writes to the render target using the
"replicated color" message. We already have a fragment shader that
does that (the shader that we use for fast color clears), so for
simplicity we re-use it.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Mon, 6 May 2013 16:38:42 +0000 (09:38 -0700)]
i965/blorp: Expand clear class hierarchy to prepare for RT resolves.
The fragment shaders that to do color clears will be re-used to
perform so-called "render target resolves" (the resolves associated
with fast color clears). To prepare for that, this patch expands the
class hierarchy for blorp params by adding
brw_blorp_const_color_params (which will be used for all blorp
operations where the fragment shader outputs a constant color).
Some other data structures and functions were also renamed to use
"const_color" nomenclature where appropriate.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Wed, 1 May 2013 15:04:12 +0000 (08:04 -0700)]
i965/gen7+: Implement fast color clear operation in BLORP.
Since we defer allocation of the MCS miptree until the time of the
fast clear operation, this patch also implements creation of the MCS
miptree.
In addition, this patch adds the field
intel_mipmap_tree::fast_clear_color_value, which holds the most recent
fast color clear value, if any. We use it to set the SURFACE_STATE's
clear color for render targets.
v2: Flag BRW_NEW_SURFACES when allocating the MCS miptree. Generate a
perf_debug message if clearing to a color that isn't compatible with
fast color clear. Fix "control reaches end of non-void function"
build warning.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Wed, 1 May 2013 01:51:51 +0000 (18:51 -0700)]
i965/gen7+: Create helper functions for single-sample MCS buffers.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Wed, 1 May 2013 14:16:52 +0000 (07:16 -0700)]
i965/gen7+: Set up MCS in SURFACE_STATE whenever MCS is present.
On Gen7+, MCS buffers are used both for compressed multisampled color
buffers and for "fast clear" of single-sampled color buffers.
Previous to this patch series, we didn't support fast clear, so we
only used MCS with multisampled bolor buffers.
As a first step to implementing fast clears, this patch modifies the
code that sets up SURFACE_STATE so that it configures the MCS buffer
whenever it is present, regardless of whether we are multisampling or
not.
Reviewed-by: Eric Anholt <eric@anholt.net>