Zack Rusin [Wed, 27 Mar 2013 09:30:38 +0000 (02:30 -0700)]
gallivm: implement implicit primitive flushing
TGSI semantics currently require an implicit endprim at the end
of GS if an ending primitive hasn't been emitted.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Mon, 18 Feb 2013 12:00:19 +0000 (04:00 -0800)]
gallium/llvm: implement geometry shaders in the llvm paths
This commits implements code generation of the geometry shaders in
the SOA paths. All the code is there but bugs are likely present.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Thu, 14 Mar 2013 08:07:28 +0000 (01:07 -0700)]
draw/gs: Fetch more than one primitive per invocation
Allows executing gs on up to 4 primitives at a time. Will also be
required by the llvm code because there we definitely don't want
to flush with just a single primitive.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Thu, 14 Mar 2013 07:42:06 +0000 (00:42 -0700)]
draw/gs: Abstract the portions of GS that are tgsi specific
To be able to add llvm paths later on we need to have some common
interface for them.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Thu, 14 Mar 2013 00:13:21 +0000 (17:13 -0700)]
draw/llvm: Remove unused gs_constants from jit_context
The member was never used and we'll need to handle it differently
because gs will also need samplers/textures setup.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Wed, 13 Mar 2013 23:46:24 +0000 (16:46 -0700)]
graw/gs: add missing max output vertices to all tests
A few tests were missing this crucial property.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Jerome Glisse [Mon, 25 Mar 2013 15:46:38 +0000 (11:46 -0400)]
radeonsi: add cs tracing v3
Same as on r600, trace cs execution by writting cs offset after each
states, this allow to pin point lockup inside command stream and
narrow down the scope of lockup investigation.
v2: Use WRITE_DATA packet instead of WRITE_MEM
v3: Remove useless nop packet
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Chris Forbes [Mon, 25 Mar 2013 10:19:07 +0000 (23:19 +1300)]
mesa: only check sample count if we actually wanted multisampling
Fixes various test fallout from
90b5a2425a on Pineview, which claims to
support ARB_internalformat_query but doesn't actually provide the
driverfunc.
That driver is still broken [GetInternalformativ will still segfault!]
but it was silly to be going through the sample count logic in the
nonmultisampling case at all.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Christian König [Tue, 26 Mar 2013 14:08:00 +0000 (15:08 +0100)]
radeon/llvm: document LLVM commit
We need at least that revision to work correctly now.
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Sun, 17 Mar 2013 15:02:42 +0000 (16:02 +0100)]
radeonsi: add preloading for all samplers
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Fri, 15 Mar 2013 14:53:25 +0000 (15:53 +0100)]
radeonsi: add preloading of all constants
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Wed, 20 Mar 2013 11:10:35 +0000 (12:10 +0100)]
radeonsi: mark most intrinsics as readnone/nounwind
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Wed, 20 Mar 2013 13:37:21 +0000 (14:37 +0100)]
radeonsi: mark all loads as constant
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Tue, 19 Mar 2013 12:36:26 +0000 (13:36 +0100)]
radeonsi: remove wqm intrinsic
Now the backend handles that itself.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Tue, 26 Mar 2013 10:37:45 +0000 (11:37 +0100)]
radeon/llvm: remove uneeded inclusion
The include isn't needed and the file has moved with LLVM master.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Christian König [Sun, 24 Mar 2013 15:24:52 +0000 (16:24 +0100)]
glsl_to_tgsi: avoid creating arrays if driver doesn't support them
Avoid creating arrays if we replace indirect addressing anyway.
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Mon, 25 Mar 2013 09:57:48 +0000 (10:57 +0100)]
glsl_to_tgsi: make simplify_cmp work with arrays
Even when we have arrays it is possible for simplify_cmp
to work on temps, just not on arrays.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=62696
Signed-off-by: Christian König <christian.koenig@amd.com>
Marek Olšák [Tue, 26 Mar 2013 00:37:40 +0000 (01:37 +0100)]
gallium/docs: document get_driver_query_info
Marek Olšák [Fri, 22 Mar 2013 01:39:42 +0000 (02:39 +0100)]
r600g: add a driver query returning the amount of requested VRAM and GTT memory
Marek Olšák [Thu, 21 Mar 2013 18:44:18 +0000 (19:44 +0100)]
r600g: add a driver query returning the number of draw_vbo calls
between begin_query and end_query
Marek Olšák [Thu, 21 Mar 2013 18:51:30 +0000 (19:51 +0100)]
st/dri: integrate the HUD
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 21 Mar 2013 18:47:06 +0000 (19:47 +0100)]
gallium: implement a heads-up display module
Reviewed-by: Brian Paul <brianp@vmware.com>
v2: lots of cosmetic changes
Marek Olšák [Thu, 21 Mar 2013 18:32:24 +0000 (19:32 +0100)]
gallium: add interface for driver queries like performance counters, etc.
The pipe query interface is reused. The list of available queries can be
obtained using pipe_screen::get_driver_query_info.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 22 Mar 2013 16:04:15 +0000 (17:04 +0100)]
gallium/tgsi: fix valgrind warning
"Conditional jump or move depends on uninitialised value(s)"
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 21 Mar 2013 23:31:47 +0000 (00:31 +0100)]
st/mesa: fix crash with blit-based GetTexImage
https://bugs.freedesktop.org/show_bug.cgi?id=62573
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Marek Olšák [Mon, 18 Mar 2013 21:36:21 +0000 (22:36 +0100)]
cso: add constant buffer save/restore feature for postprocessing
Postprocessing is an internal meta op and should restore the states
it changes.
Marek Olšák [Thu, 21 Mar 2013 18:29:29 +0000 (19:29 +0100)]
radeonsi: fix crash while binding a NULL constant buffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 21 Mar 2013 18:29:29 +0000 (19:29 +0100)]
r600g: fix crash while binding a NULL constant buffer
Marek Olšák [Thu, 21 Mar 2013 18:29:29 +0000 (19:29 +0100)]
r300g: fix crash while binding a NULL constant buffer
Martin Andersson [Mon, 25 Mar 2013 22:11:34 +0000 (23:11 +0100)]
r600g: Use virtual address for PIPE_QUERY_SO* in r600_emit_query_end
Virtual address is used for PIPE_QUERY_SO* queries in
r600_emit_query_begin, but not in r600_emit_query_end.
This will trigger a GPU fault when one of those queries is
made and virtual address is enabled.
Note: this is a candidate for the 9.1 branch
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Rob Clark [Mon, 25 Mar 2013 18:57:24 +0000 (14:57 -0400)]
freedreno: use u_debug for debug env vars
Signed-off-by: Rob Clark <robdclark@gmail.com>
Jordan Justen [Sun, 10 Mar 2013 01:12:09 +0000 (17:12 -0800)]
glsl ir: add as_dereference_record
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Mon, 25 Mar 2013 16:24:01 +0000 (10:24 -0600)]
gallium: undef PACKAGE_* macros to silence warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Mon, 25 Mar 2013 16:23:42 +0000 (10:23 -0600)]
gallivm: init vars to silence warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Mon, 25 Mar 2013 16:23:27 +0000 (10:23 -0600)]
swrast: init vars to silence warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Rob Clark [Mon, 25 Mar 2013 15:55:18 +0000 (11:55 -0400)]
freedreno: prefer sw upload for textures
Since we are UMA, in most cases the GPU blit doesn't make much sense for
texture upload.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Wed, 6 Mar 2013 15:45:58 +0000 (10:45 -0500)]
freedreno: track maximal scissor bounds
Optimize out parts of the render target that are scissored out by taking
into account maximal scissor bounds in fd_gmem_render_tiles().
This is a big win on things like gnome-shell which frequently do partial
screen updates.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Adrian Marius Negreanu [Fri, 22 Mar 2013 11:42:40 +0000 (13:42 +0200)]
android: fix Android.mk bug in mesa/drivers/dri/common
target-specific variables are undefined when used as pre-requisites.
instead, use secondary-expansion.
I noticed this when building the patch:
i965: Add a driconf option to disable flush throttling
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Mon, 18 Mar 2013 15:42:19 +0000 (08:42 -0700)]
mesa: Disable validate_ir_tree() on release builds.
Since half of ir_validate uses asserts() (the other using printf() then
abort()), there's not much use to calling it in a release build. Cuts
6.3% of the startup time of TF2.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Roland Scheidegger [Sun, 24 Mar 2013 01:08:01 +0000 (02:08 +0100)]
gallivm: move code for dealing with rgb9e5 and r11g11b10 formats to own file
This is really not generic conversion stuff and the code very particular to
these formats.
Vinson Lee [Sat, 23 Mar 2013 07:24:52 +0000 (00:24 -0700)]
llvmpipe: Fix assertions with assignment instead of comparison.
Fixes assign instead of compare defects reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Paul Berry [Fri, 22 Mar 2013 00:14:53 +0000 (17:14 -0700)]
i965: Shrink brw_vue_map struct.
This patch changes the arrays in brw_vue_map (which only ever contain
values from -1 to 58) from ints to signed chars. This reduces the
size of the struct from 488 bytes to 136 bytes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: fix STATIC_ASSERT to use 127 instead of 128.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Wed, 20 Mar 2013 17:15:52 +0000 (10:15 -0700)]
i965/fs: Rename vp_outputs_written to input_slots_valid.
With the introduction of geometry shaders, fragment inputs will no
longer come exclusively from the vertex shader; sometimes they come
from the geometry shader. So the name "vp_outputs_written" will
become a misnomer. This patch renames vp_outputs_written to
input_slots_valid, to reflect the true meaning of the bitfield from
the fragment shader's point of view: it indicates which of the
possible input slots contain valid data that was written by the
previous shader stage.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Sun, 17 Mar 2013 18:29:28 +0000 (11:29 -0700)]
i965: Use brw.vue_map_geom_out instead of VS output VUE map where appropriate.
This patch modifies post-GS pipeline stages (transform feedback, clip,
sf, fs) to refer to the VUE map through brw->vue_map_geom_out rather
than brw->vs.prog_data->vue_map. This ensures that when geometry
shader support is added, these pipeline stages will consult the
geometry shader output VUE map when appropriate, rather than the
vertex shader output VUE map.
v2: Fixed some stale "CACHE_NEW_VS_PROG" comments.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Mon, 18 Feb 2013 18:16:02 +0000 (10:16 -0800)]
i965: Store the geometry output VUE map in brw_context.
Currently, the GPU pipeline has one active VUE map in effect at any
given time--the one representing the layout of vertex data coming from
the vertex shader. However, when geometry shaders are added, they
will have their own independent VUE map. Later pipeline stages (clip,
sf, fs) will need to consult the geometry shader VUE map if a geometry
shader is in use, and the vertex shader VUE map otherwise.
This patch adds a new field to brw_context, vue_map_geom_out, which
contains the VUE map that should be used by later pipeline stages. It
also adds a new state flag, BRW_NEW_VUE_MAP_GEOM_OUT, which is
signalled whenever the contents of the VUE map changes.
Since we don't support geometry shaders yet, vue_map_geom_out is
currently set only by the brw_vs_prog state atom.
v2: Don't set vue_map_geom_out in do_vs_prog--that's redundant and
possibly problematic for precompiles. Only set it in
brw_upload_vs_prog. Also, make a copy instead of using a
pointer--this makes it possible to detect when the VUE map hasn't
changed, so we can avoid redundant state uploads.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Sun, 17 Mar 2013 18:13:56 +0000 (11:13 -0700)]
i965: Move brw_vs_prog_data::outputs_written into VUE map.
Future patches will allow for there to be separate VUE maps when both
a geometry shader and a vertex shader are in use. When this happens,
we will want to have correspondingly separate outputs_written
bitfields. Moving outputs_written into the VUE map will make this
easy.
For consistency with the terminology used in the VUE map, the bitfield
is renamed to "slots_valid" in the process.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Sat, 23 Mar 2013 15:23:03 +0000 (08:23 -0700)]
i965/gen7: Use WE_all mode when enabling channel masks for URB write.
Gen7 adds mask bits to the message header for a URB write which allow
the write to apply only to certain channels. We don't use this
functionality, so to ensure that the entire write always occurs, we
emit an OR instruction to set the mask bits.
With the advent of geometry shaders, URB writes won't just happen at
the end of a thread; they will happen in mid-thread too. Thus, we can
no longer rely on channel 0 being enabled, so we need to emit the OR
instruction in WE_all mode to ensure that it is executed.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Sat, 23 Mar 2013 22:53:33 +0000 (15:53 -0700)]
i965: Rename BRW_VARYING_SLOT_MAX -> BRW_VARYING_SLOT_COUNT.
The new name clarifies that it represents *one more* than the maximum
possible brw_varying_slot value.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Fri, 22 Mar 2013 16:39:11 +0000 (09:39 -0700)]
i965: Clarify nomenclature: vert_result -> varying
This patch removes the terminology "vert_result" from the i965 driver,
replacing it with "varying". The old terminology, "vert_result", was
confusing because (a) it referred to the enum gl_vert_result, which no
longer exists (it was replaced with gl_varying_slot), and (b) it
implied a vertex output, but with the advent of geometry shaders, it
could be either a vertex or a geometry output, depending what shaders
are in use. The generic term "varying" is less confusing.
No functional change.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Whitespace fixes.
Chris Forbes [Sun, 24 Mar 2013 03:21:01 +0000 (16:21 +1300)]
i965: bump MAX_DEPTH_TEXTURE_SAMPLES to 4/8
Bump MAX_DEPTH_TEXTURE_SAMPLES to match what GetInternalformativ is
claiming. Since that limit is what is actually enforced now, this
doesn't actually change anything except the queried value.
There's still no piglits verifying that multisample depth textures work,
but this works in the Unigine demos.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Sun, 3 Mar 2013 08:46:12 +0000 (21:46 +1300)]
mesa: use _mesa_check_sample_count() for multisample textures
Extends _mesa_check_sample_count() to properly support the
TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY targets, which
have subtly different limits than renderbuffers.
This resolves the remaining TODO in the implementation of
TexImage*DMultisample.
V2: - Don't introduce spurious block.
- Do this in multisample.c instead.
- Fix typo in error message.
- Inline spec quotes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Wed, 6 Feb 2013 07:42:53 +0000 (20:42 +1300)]
mesa: helper for checking renderbuffer sample count
Pulls the checking of the sample count into a helper function, and
extends the existing logic to include the interactions with both
ARB_texture_multisample and ARB_internalformat_query.
_mesa_check_sample_count() checks a desired sample count against a
a combination of target/internalformat, and returns the error enum
to be produced, if any. Unfortunately the conditions are messy and the
errors vary.
V2: - Tidy up spurious block.
- Move _mesa_check_sample_count() to multisample.c instead; It
doesn't really belong in fbobject.c or teximage.c.
- Inlined spec quotes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Sat, 16 Feb 2013 07:47:11 +0000 (20:47 +1300)]
mesa: allow internalformat_query with multisample texture targets
Now that we support ARB_texture_multisample, there are multiple targets
accepted for this query, and they may have target-dependent limits, so
pass the target to the driverfunc.
For example, the sampling hardware may not be able to do general
texelFetch() for some format/sample count combination, but the driver
may still be able to implement a reasonable resolve operation, so it can
be supported for renderbuffers.
V2: - Don't break Gallium compile.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Dmitry Cherkassov [Sat, 23 Mar 2013 19:51:22 +0000 (23:51 +0400)]
clover: add dynamic_cast results checking down in clSetKernelArgument() code path.
Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Roland Scheidegger [Sat, 23 Mar 2013 01:05:54 +0000 (02:05 +0100)]
gallivm: Add code for rgb9e5 shared exponent format to float conversion
And use this (and the code for r11g11b10 packed float to float conversion)
in the soa texturing code (the generated code looks quite good).
Should be an order of magnitude faster probably than using the fallback
(not measured).
Tested with piglit texwrap GL_EXT_packed_float and
GL_EXT_texture_shared_exponent respectively (didn't find much else using
it).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Marek Olšák [Thu, 14 Mar 2013 16:18:43 +0000 (17:18 +0100)]
gallium,st/mesa: don't use blit-based transfers with software rasterizers
The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very
fast with software rasterizer. Now Gallium drivers have the ability to turn
them off.
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Mar 2013 15:36:22 +0000 (16:36 +0100)]
st/mesa: implement blit-based ReadPixels
Initial version contributed by: Martin Andersson <g02maran@gmail.com>
This is only used if the memcpy path cannot be used and if no transfer ops
are needed. It's pretty similar to our TexImage and GetTexImage
implementations.
The motivation behind this is to be able to use ReadPixels every frame and
still have at least 20 fps (or 60 fps with a powerful GPU and CPU)
instead of 0.5 fps.
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Mar 2013 14:20:27 +0000 (15:20 +0100)]
mesa: add common format-independent memcpy-based ReadPixels path
I'll need the _mesa_readpixels_needs_slow_path function for the blit-based
version, but it's also useful to have this memcpy-based path in one place
and not scattered across several functions.
v2: add "const" to function parameters
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Mar 2013 13:22:56 +0000 (14:22 +0100)]
mesa: add helper func for checking combined depthstencil buffers from st/mesa
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Mar 2013 12:15:54 +0000 (13:15 +0100)]
mesa: add a common function returning transfer ops for ReadPixels
I'll need both new functions for later. For now, it consolidates the code
for determining what the transfer ops should be and makes it a little bit
smarter.
v2: added "const"
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 13 Mar 2013 15:47:21 +0000 (16:47 +0100)]
mesa: handle HALF_FLOAT like FLOAT in get_tex_rgba
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Roland Scheidegger [Fri, 22 Mar 2013 19:09:18 +0000 (20:09 +0100)]
llvmpipe: add EXT_packed_float render target format support
New conversion code to handle conversion from/to r11g11b10 AoS to/from
SoA floats, and also add code for conversion from rgb9e5 AoS to float SoA
(which works pretty much the same as r11g11b10 except for the packing).
(This code should also be used for texture sampling instead of
relying on u_format conversion but it's not yet, so rgb9e5 is unused.)
Unfortunately a crazy amount of hacks is necessary to get the conversion
code running in llvmpipe's generate_unswizzled_blend, which isn't well
suited for formats where the storage representation has nothing to do
with what's needed for blending (moreover, the conversion will convert
from packed AoS values, which is the storage format, to float SoA values,
because this is much more natural for the conversion, and likewise from
SoA values to packed AoS values - but the "blend" (which includes
trivial things like partial mask) works on AoS values, so incoming fs
values will go SoA->AoS, values from destination will go packed
AoS->SoA->AoS, then do blend, then AoS->SoA->packed AoS which probably
isn't the most efficient way though the shuffles are probably bearable).
Passes piglit fbo-blending-formats (with GL_EXT_packed_float parameter),
still need to verify Inf/NaNs (where most of the complexity in the
conversion comes from actually).
v2: drop the (very bogus) rgb9e5 part, and do component extraction
in the helper code for r11g11b10 to float conversion, making the code
slightly more compact (suggested by Jose), now that there are no other
callers left this works quite well. (Could do the same for the
opposite way but it's less than ideal there, final part of packing
needs to be done in caller anyway and there'd be another conditional.)
v3: minor style and comment fixes. Also fix a potential issue with
negative zero being potentially returned by max(src, zero) as we
don't have well-defined min/max behavior (fortunately no additonal cost).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Michel Dänzer [Thu, 21 Mar 2013 16:56:52 +0000 (17:56 +0100)]
r600g: Honour legacy debugging environment variables
This helps minimize confusion / effort when moving between branches or
helping others.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Matt Turner [Thu, 21 Mar 2013 22:59:08 +0000 (15:59 -0700)]
docs: Mark ARB_ES3_compatibility as done.
Rob Clark [Thu, 21 Mar 2013 21:32:00 +0000 (17:32 -0400)]
freedreno: add pipe->blit
Signed-off-by: Rob Clark <robdclark@gmail.com>
Paul Berry [Tue, 19 Mar 2013 18:49:08 +0000 (11:49 -0700)]
i965: Add a driconf option to disable flush throttling.
Normally when submitting the first batch buffer after a flush, we
check whether the GPU has completed processing of the first batch
buffer of the previous frame. If it hasn't, we wait for it to finish
before submitting any more batches. This prevents GPU-heavy and
CPU-light applications from racing too far ahead of the current frame,
but at the expense of possibly lower frame rates. Sometimes when
benchmarking we want to disable this mechanism.
This patch adds the driconf option "disable_throttling" to disable the
throttling mechanism.
Reviewed-by: Eric Anholt <eric@anholt.net>
Matt Turner [Mon, 4 Mar 2013 19:03:58 +0000 (11:03 -0800)]
mesa: Implement TEXTURE_IMMUTABLE_LEVELS for ES 3.0.
NOTE: This is a candidate for the 9.1 branch.
Fixes piglit's texture-immutable-levels test.
Reported-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Adam Jackson [Thu, 21 Mar 2013 17:21:18 +0000 (13:21 -0400)]
glx: Build with VISIBILITY_CFLAGS in automake
Note: This is a candidate for the stable branches.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Brian Paul [Wed, 20 Mar 2013 15:41:52 +0000 (09:41 -0600)]
scons: check for existance of 'MSVC_VERSION' in env
Evidently, MSVC_VERSION isn't always defined so check for it before
checking the MSVC version.
Suggested by Jose.
Brian Paul [Wed, 20 Mar 2013 17:05:13 +0000 (11:05 -0600)]
softpipe: silence some asst. MSVC type warnings in sp_tex_sample.c
Brian Paul [Wed, 20 Mar 2013 16:56:47 +0000 (10:56 -0600)]
softpipe: silence some MSVC signed/unsigned warnings
Brian Paul [Wed, 20 Mar 2013 16:56:24 +0000 (10:56 -0600)]
softpipe: silence some MSVC float/double warnings
Brian Paul [Wed, 20 Mar 2013 16:54:24 +0000 (10:54 -0600)]
rbug: silence some MSVC signed/unsigned warnings
Brian Paul [Wed, 20 Mar 2013 16:54:07 +0000 (10:54 -0600)]
postprocess: silence some MSVC float/int warnings
Brian Paul [Wed, 20 Mar 2013 15:58:18 +0000 (09:58 -0600)]
meta: fix incorrect slice, r coordinate computation
The arithmetic to convert a 3D texture slice to an R coordinate was
incorrect. Found when MSVC warned of a divide by zero.
Note that we don't actually ever hit this path. We don't decompress
slices of 3D textures and we don't support 3D mipmap generation yet.
Brian Paul [Wed, 20 Mar 2013 15:57:21 +0000 (09:57 -0600)]
vega: fix MSVC warning about missing return statement
Brian Paul [Wed, 20 Mar 2013 15:27:14 +0000 (09:27 -0600)]
meta: minor indentation fix
Michel Dänzer [Tue, 19 Mar 2013 16:57:11 +0000 (17:57 +0100)]
radeonsi: Emit pixel shader state even when only the vertex shader changed
Fixes random failures with piglit glsl-max-varyings.
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Christian König <christian.koenig@amd.com>
Chad Versace [Mon, 18 Mar 2013 20:56:28 +0000 (13:56 -0700)]
android: Define PACKAGE_VERSION/BUGREPORT in CFLAGS
This fixes the Android build. Commit 439c3d4 broke it.
CC: Adrian M Negreanu <adrian.m.negreanu@intel.com>
CC: Matt Turner <mattst@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Kenneth Graunke [Mon, 11 Mar 2013 18:10:34 +0000 (11:10 -0700)]
i965/vs: Add IR dumping for immediates.
This makes dump_instructions more useful.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 19 Mar 2013 01:57:28 +0000 (18:57 -0700)]
glsl: Add built-in functions for GLSL 1.50.
This makes basic built-in functions work in GLSL 1.50. It supports
everything except the new Geometry Shader functions.
The new 150.glsl file is 140.glsl plus ARB_texture_multisample.glsl;
150.frag is identical to 140.frag except for the #version bump.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Kenneth Graunke [Tue, 19 Mar 2013 01:57:27 +0000 (18:57 -0700)]
glsl: Add sampler2DMS/sampler2DMSArray types to GLSL 1.50.
GLSL 1.50 includes support for the new sampler types introduced by
the ARB_texture_multisample extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Kenneth Graunke [Tue, 19 Mar 2013 01:57:26 +0000 (18:57 -0700)]
glsl: Bump standalone compiler versions to 1.50.
The version bumps are necessary in order to compile built-ins for 1.50.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Kenneth Graunke [Fri, 15 Mar 2013 21:48:24 +0000 (14:48 -0700)]
i965: Don't use texture swizzling to force alpha to 1.0 if unnecessary.
Commit
33599433c7 began setting the texture swizzle mode to XYZ1 for
RED, RG, and RGB textures in order to force alpha to 1.0 in case we
actually stored the texture as RGBA.
This had a unforseen performance implication: the shader precompile
assumes that the texture swizzle mode will be XYZW for non-shadow
sampler types. By setting it to XYZ1, this means every shader used with
a RED, RG, or RGB texture has to be recompiled. This is a very common
case.
Unfortunately, there's no way to improve the precompile, since RGBA
textures still need XYZW, and there's no way to know by looking at
the shader source what texture formats might be used.
However, we only need to smash alpha to 1.0 if the texture's memory
format actually has alpha bits. If not, the sampler already returns 1.0
for us without any special swizzling. XRGB8888, for example, is a very
common case where this occurs.
This partially fixes a performance regression since commit
33599433c7.
More work is required to fully fix it in all cases. This at least helps
Warsow.
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 14 Mar 2013 18:48:36 +0000 (11:48 -0700)]
i965: Don't print a fatal-looking message if intelCreateContext fails.
With the old context creation mechanism, an application asked the GL to
give it a context. Failing to produce a context was a fatal error.
Now, with GLX_ARB_create_context, the application can request a specific
version. If it's higher than the maximum version we support, context
creation will fail. But this is a normal error that applications
recover from.
In particular, the new glxinfo tries to create OpenGL 4.3, 4.2, 4.1,
4.0, 3.3, and 3.2 contexts before finally succeeding at creating a 3.1
context. This led to it printing the following message 6 times:
"brwCreateContext: failed to init intel context"
There's no need to alarm users (and developers) with such a message.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Mon, 18 Mar 2013 22:38:58 +0000 (15:38 -0700)]
i965/gen7: Align all depth miplevels to 8 in the X direction.
On an INTEL_DEBUG=perf piglit run on IVB, reduces the instances of "HW
workaround: blit" (the printouts from the misaligned-depth workaround
blits) from 725 to 675.
It doesn't totally eliminate the workaround blit, because we still have
problems with Y offsets that we can't fix (since texturing can only align
miplevels up to 2 or 4, not 8).
No regressions on piglit/es3conform on IVB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Christoph Bumiller [Fri, 15 Mar 2013 22:39:01 +0000 (23:39 +0100)]
nvc0: fix max varying count, move CLIPVERTEX,FOG out of the way
The card spews an error if I use all 128 generic slots.
Apparently the real limit isn't just dictated by the address space
layout.
Christoph Bumiller [Fri, 15 Mar 2013 21:11:31 +0000 (22:11 +0100)]
gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3
This makes it possible to identify gl_TexCoord and gl_PointCoord
for drivers where sprite coordinate replacement is restricted.
The new PIPE_CAP_TGSI_TEXCOORD decides whether these varyings
should be hidden behind the GENERIC semantic or not.
With this patch only nvc0 and nv30 will request that they be used.
v2: introduce a CAP so other drivers don't have to bother with
the new semantic
v3: adapt to introduction gl_varying_slot enum
Ian Romanick [Wed, 20 Mar 2013 00:44:31 +0000 (17:44 -0700)]
docs: import release notes for 9.1.1, add news item
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Kristian Høgsberg [Wed, 20 Mar 2013 00:16:57 +0000 (20:16 -0400)]
gallium-egl: Fix compile errors introduced in
de315f76a
The commit changed API in a helper library shared by both egl_dri2 and
the gallium egl state tracker, but only egl_dri2 was updated to use the
new interface.
Tested-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Paul Berry [Sat, 23 Feb 2013 00:40:41 +0000 (16:40 -0800)]
i965/fs: Avoid unnecessary recompiles due to POS bit of proj_attrib_mask.
Previous to this patch, when using fixed function fragment shading,
bit VARYING_BIT_POS of brw_wm_prog_key::proj_attrib_mask was being set
differently during precompiles and normal usage. During precompiles
it was being set only if the fragment shader reads from window
position (which it never does), so it was always being set to 0.
During normal usage it was being set if the vertex shader writes to
all 4 components of gl_Position (which it usually does), so it was
usually being set to 1. As a result, we were almost always doing an
extra recompile for the fixed function fragment shader.
The recompile was totally unnecessary, though, because
brw_wm_prog_key::proj_attrib_mask is only consulted for
fs_visitor::emit_general_interpolation(), which isn't used for
VARYING_SLOT_POS.
This patch avoids the unnecessary recompile by always setting bit
VARYING_BIT_POS of brw_wm_prog_key::proj_attrib_mask to 1.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Fri, 22 Feb 2013 23:37:41 +0000 (15:37 -0800)]
ff_fragment_shader: Don't do unnecessary (and dangerous) uniform setup.
Previously, right after calling _mesa_glsl_link_shader(), the fixed
function fragment shader code made several calls with the ostensible
purpose of setting up uniforms for the fragment shader it just
created.
These calls are unnecessary, since _mesa_glsl_link_shader() calls
driver->LinkShader(), which takes care of calling these functions (or
their equivalent). Also, they are dangerous to call after
_mesa_glsl_link_shader() has returned, because on back-ends such as
i965 which do precompilation, _mesa_glsl_link_shader() may have
already cached pointers to the existing uniform structures; attempting
to set up the uniforms again invalidates those cached pointers.
It was only by sheer coincidence that this wasn't manifesting itself
as a bug. It turns out that i965's precompile mechanism was always
setting bit 0 of brw_wm_prog_key::proj_attrib_mask to 0 for fixed
function fragment shaders, but during normal usage this bit usually
gets set to 1. As a result, the precompiled shader (with its invalid
uniform pointers) was not being used.
I'm about to introduce some changes that cause bit 0 of
proj_attrib_mask to be set consistently between precompilation and
normal usage, so to avoid regressions I need to get rid of the
dangerous duplicate uniform setup code first.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Paul Berry [Fri, 8 Mar 2013 21:39:43 +0000 (13:39 -0800)]
i965: Avoid unnecessary copy when depthstencil workaround invoked by clear.
Since apps typically begin rendering with a call to glClear(), it is
likely that when brw_workaround_depthstencil_alignment() moves a
miplevel to a temporary buffer, it can avoid doing a blit, since the
contents of the miplevel are about to be erased.
This patch adds the necessary plumbing to determine when
brw_workaround_depthstencil_alignment() is being called as a
consequence of glClear(), and avoids the unnecessary blit when it is
safe to do so.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Eliminate unnecessary call to _mesa_is_depthstencil_format(). Fix
handling of depth buffer in depth/stencil format.
v3: Use correct bitfields for clear_mask. Fix handling of depth
buffer in depth/stencil format when hardware uses separate stencil.
When invalidating, make sure we still reassociate the image to the new
miptree.
Reviewed-by: Eric Anholt <eric@anholt.net>
Alex Deucher [Tue, 19 Mar 2013 22:11:20 +0000 (18:11 -0400)]
r600g: don't emit SQ_DYN_GPR_RESOURCE_LIMIT_1 on cayman
Doesn't exist on the asic and will cause a CS rejection
if VM is disabled.
Note: this is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher [Tue, 19 Mar 2013 18:25:32 +0000 (14:25 -0400)]
r600g: emit DB_SRESULTS_COMPARE_STATE0 on r6xx/r7xx
Not using HiS yet, but matches what we do on evergreen+.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Brian Paul [Tue, 19 Mar 2013 16:03:39 +0000 (10:03 -0600)]
winsys/svga: improve error/debug message output
Use vmw_printf() just for extra debugging info (off by default).
Use vmw_error() for real errors/failures/etc that we definitely
want to report.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Brian Paul [Tue, 19 Mar 2013 19:49:42 +0000 (13:49 -0600)]
tgsi: fix uninitialized declaration array fields
Fixes a few regressions since the TGSI array changes.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Kristian Høgsberg [Tue, 19 Mar 2013 17:20:36 +0000 (13:20 -0400)]
egl_dri2: Lower __DRI_IMAGE version requirement back to 1
We check the extension version manually instead and verify that we have
the createImageFromFds function before enabling prime fd passing.
Maarten Lankhorst [Tue, 19 Mar 2013 19:17:57 +0000 (20:17 +0100)]
radeon/llvm: Do not link against libgallium when building statically.
NOTE: This is a candidate for the 9.1 branch.
Tested-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Matt Turner [Wed, 30 Jan 2013 01:37:02 +0000 (17:37 -0800)]
gles2: Add an ABI-check test
Checks that no functions are exported that are not part of the ABI.
Note that currently we are exporting functions that are aliased to
functions that are part of the ABI. They shouldn't be exported, but the
XML descriptions don't adequately describe this case.