José Fonseca [Wed, 21 Aug 2013 15:49:57 +0000 (16:49 +0100)]
gallium: Support PIPE_FORMAT_R10G10B10A2_UINT.
Same as PIPE_FORMAT_B10G10R10A2_UINT but without the swizzling.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Wed, 31 Jul 2013 17:31:44 +0000 (18:31 +0100)]
trace: Handle null tokens.
Used for example on stream out without geometry shader.
Chia-I Wu [Thu, 22 Aug 2013 06:59:03 +0000 (14:59 +0800)]
ilo: do not need last shader stage for 3DSTATE_SBE
We have set up 3DSTATE_SBE (or 3DSTATE_SF on GEN6) in
ilo_shader_select_kernel_routing(). There is no need to pass the last shader
stage to the GPE function.
Chia-I Wu [Thu, 22 Aug 2013 06:53:11 +0000 (14:53 +0800)]
ilo: fix a potential issue with STATE_SIP
Command length is ORed to the wrong place. Since the ORed value is zero,
there is no real change.
Chia-I Wu [Thu, 22 Aug 2013 06:55:13 +0000 (14:55 +0800)]
ilo: add GEN check to 3DSTATE_CLIP
Assert that gen6_emit_3DSTATE_CLIP is for GEN 6 and 7.
Matt Turner [Tue, 20 Aug 2013 21:16:17 +0000 (14:16 -0700)]
build: Add --enable-gallium-osmesa flag.
The Gallium implementation is apparently not ready for regular
consumption, so as much as I hate adding more build-time options, here's
another.
Acked-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Thu, 15 Aug 2013 18:24:11 +0000 (11:24 -0700)]
glsl: Give a warning, not an error, for UBO qualifiers on non-matrices.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59648
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Matt Turner [Thu, 15 Aug 2013 18:14:00 +0000 (11:14 -0700)]
glsl: Remove ubo_qualifiers_allowed variable.
No longer used.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Matt Turner [Thu, 15 Aug 2013 17:46:46 +0000 (10:46 -0700)]
glsl: Drop duplicate error messages.
This same message is printed in the validate_matrix_layout_for_type
function.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Matt Turner [Thu, 15 Aug 2013 18:05:57 +0000 (11:05 -0700)]
glsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.
The variable means that UBO qualifiers are allowed in a particular
context (e.g., not allowed in a struct field declaration), rather than a
particular set of UBO qualifiers are valid.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Kenneth Graunke [Mon, 19 Aug 2013 01:06:13 +0000 (18:06 -0700)]
i965/fs: Add code to print out global copy propagation sets.
This was invaluable when debugging the global copy propagation
algorithm. We may as well commit it in case someone needs to print
out the sets in the future.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Armin K [Wed, 21 Aug 2013 14:44:00 +0000 (08:44 -0600)]
osmesa: Symlink shared library to LIB_DIR
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Brian Paul [Tue, 20 Aug 2013 22:54:35 +0000 (16:54 -0600)]
svga: minor clean-ups in emit_hw_vs_vdecl()
Roland Scheidegger [Wed, 21 Aug 2013 20:01:12 +0000 (22:01 +0200)]
gallivm: unify sin and cos implementation
The (complicated!) math is all identical, there's just minimal differences how
sign bit is calculated plus there's an additional subtraction for the argument
going into the polynomial for cos.
The logic stays 100% the same (with a small exception, sign bit calculation for
sin is minimally simplified, applying sign mask after xoring the arguments
instead of applying it to each argument).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Wed, 21 Aug 2013 18:35:51 +0000 (20:35 +0200)]
gallivm: add comment for bogus min/mag filter selection with nearest mip filter
Detected this hunting some other bug, not sure if it really needs fixing but
it is definitely wrong.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Wed, 21 Aug 2013 14:54:58 +0000 (16:54 +0200)]
gallivm: fix rho calculation for 1d case
Was using wrong (undefined) vector element (the elements are at 0/2 position,
not 0/1).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Ville Syrjälä [Mon, 12 Aug 2013 13:07:08 +0000 (16:07 +0300)]
i965/gen7: Set MOCS L3 cacheability for IVB/BYT (v2)
IVB/BYT also has the same L3 cacheability control in MOCS as HSW,
so let's make use of it.
pts/xonotic and pts/reaction @ 1920x1080 gain ~4% on my IVB GT2. Most
other things show less gains/no regressions, except furmark which
loses some 10 points.
I didn't have a BYT at hand for testing.
v2: Don't check (brw->gen == 7) in gen7 functions. (chadv)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Ville Syrjälä [Mon, 12 Aug 2013 13:07:07 +0000 (16:07 +0300)]
i965/hsw: Populate MOCS for STATE_BASE_ADDRESS (v2)
Just spotted these unpopulated MOCS fields when comparing the code
against BSpec. Set the MOCS to the same as everywhere else in Haswell:
L3-cacheable.
v2: Annotate state packet fields (chadv).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Maarten Lankhorst [Wed, 21 Aug 2013 16:34:59 +0000 (18:34 +0200)]
glapi/gen: build temporary files in the build directory
Writing to the source directory can cause multiple parallel builds
from the same source to fail. Create the temporary files in the
build directory.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Mon, 19 Aug 2013 21:27:31 +0000 (14:27 -0700)]
mesa: Never advertise _S3TC compressed formats
The NVIDIA driver doesn't expose them, and piglit's
arb_texture_compression-invalid-formats expects them to not be there.
This, with the previous commit, fixes piglit
arb_texture_compression-invalid-formats.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Mon, 19 Aug 2013 20:16:54 +0000 (13:16 -0700)]
mesa: Only advertise GL_ETC1_RGB8_OES in ES contexts
There is no extension for this format in desktop GL, so an application
can't give the format back to glCompressedTexImage2D.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 22:17:18 +0000 (15:17 -0700)]
glsl: Track existence of default float precision in GLSL ES fragment shaders
This is required by the spec, and it's a bit tricky because the default
precision is scoped. As a result, I'm slightly abusing the symbol
table.
Fixes piglit no-default-float-precision.frag tests and the piglit
default-precision-nested-scope-0[1234].frag tests that are currently on
the piglit mailing list for review.
On IRC I got confirmation from cwabbot that ARM (Mali T6xx and T400)
enforces this requirement and from kusma that NVIDIA (Tegra2) enforces
this requirement. We should be safe from regressing shipping
applications.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 23:01:04 +0000 (16:01 -0700)]
glsl: Merge precision qualifiers too
We never noticed this before because we previously didn't enfoce GLSL ES
fragement shader requirements that precision be defined. There may also
have been some interaction here with the addition of
GL_ARB_shading_language_420pack, but it doesn't appear to me that it
added any new bugs (just perhaps uncovered some old ones).
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 22:15:45 +0000 (15:15 -0700)]
glsl: Pass type to is_valid_default_precision_type instead of name
This is used by the next patch.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Rico Schüller [Wed, 21 Aug 2013 08:06:54 +0000 (10:06 +0200)]
vdpau/decode: Fix comment.
Reviewed-by: Christian König <christian.koenig@amd.com>
Rico Schüller [Wed, 21 Aug 2013 08:06:42 +0000 (10:06 +0200)]
vl/query: Only support VDP_CHROMA_TYPE_420 for 12 bit formats.
Reviewed-by: Christian König <christian.koenig@amd.com>
Roland Scheidegger [Tue, 20 Aug 2013 02:20:33 +0000 (04:20 +0200)]
util: add avx2 and xop detection to cpu detection code
Going to need this soon (not going to bother with avx2 intrinsics at this time
but don't want to do workarounds for true vector shifts if llvm itself can use
them just fine and won't need the gazillion instruction emulation).
Not really tested other than my cpu returns 0 for these features...
(I have no idea if llvm actually would emit avx2/xop instructions neither...)
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 20 Aug 2013 02:14:24 +0000 (04:14 +0200)]
gallivm: fix bogus aos path detection
Need to check the wrap mode of the actually used coords not a fixed 2.
While checking more than necessary would only potentially disable aos and
not cause any harm I'm pretty sure for 3d textures it could have caused
assertion failures (if s,t coords have simple filter and r not).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 20 Aug 2013 02:11:02 +0000 (04:11 +0200)]
gallivm: do clamping of border color correctly for all formats
Turns out it is actually very complicated to figure out what a format really
is wrt range, as using channel information for determining unorm/snorm etc.
doesn't work for a bunch of cases - namely compressed, subsampled, other.
Also while here add clamping for uint/sint as well - d3d10 doesn't actually
need this (can only use ld with these formats hence no border) and we could
do this outside the shader for GL easily (due to the fixed texture/sampler
relation) do it here too just so I can forget about it.
v2: move border color clamping out of fetch texel. Also change it to clamp
the whole border vector at once (and use vectorized load of border color),
which saves a couple of instructions - needs some different handling of
mixed signed/unsigned formats so skip the per channel stuff and just derive
this from first channel except for special formats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Mon, 19 Aug 2013 19:12:59 +0000 (21:12 +0200)]
gallivm: implement better control of per-quad/per-element/scalar lod
There's a new debug value used to disable per-quad lod optimizations
in fragment shader (ignored for vs/gs as the results are just too wrong
typically). Also trying to detect if a supplied lod value is really a
scalar (if it's coming from immediate or constant file) in which case
sampler code can use this to stay on per-quad-lod path (in fact for
explicit lod could simplify even further and use same lod for both
quads in the avx case but this is not implemented yet).
Still need to actually implement per-element lod bias (and derivatives),
and need to handle per-element lod in size queries.
v2: fix comments, prettify.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Tue, 20 Aug 2013 14:23:23 +0000 (08:23 -0600)]
mesa: use ARRAY_SIZE() macro instead of magic number
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ross Burton [Tue, 6 Aug 2013 18:09:39 +0000 (19:09 +0100)]
build: fix out-of-tree builds in gallium/auxiliary
The rules were writing files to e.g. util/u_indices_gen.py, but in an
out-of-tree build this directory doesn't exist in the build directory. So,
create the directories just in case.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Michel Dänzer [Mon, 19 Aug 2013 13:45:32 +0000 (15:45 +0200)]
radeonsi: Always pre-load separate VGPRs for centroid vs. center interpolation
The LLVM R600 backend currently always uses separate VGPRs for these.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68162
(Centroid interpolation is identical to center interpolation without
multisampling, so the shader hardware was only pre-loading one set of
interpolation coefficients, and the pixel shader code was using
uninitialized values as the centroid interpolation coefficients)
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Michel Dänzer [Fri, 9 Aug 2013 12:58:21 +0000 (14:58 +0200)]
radeonsi: Fix SPI_BARYC_CNTL register initialization
The centroid / center interpolation related bits have different meanings
as of SI.
Fixes 7 centroid interpolation related piglit tests.
Maarten Lankhorst [Tue, 20 Aug 2013 10:35:28 +0000 (12:35 +0200)]
gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa
Fixes a opengl crash in wine.
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Maarten Lankhorst [Tue, 20 Aug 2013 08:44:53 +0000 (10:44 +0200)]
gallium/osmesa: link against static libglapi library too to get the gl exports
This should fix missing symbols in a osmesa built against shared glapi
osmesa build. All opengl exports were missing that are defined in the
static glapi, so link against both to fix this.
I could swear I've done this before, maybe there was a glitch in the matrix.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47824
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Kenneth Graunke [Thu, 15 Aug 2013 01:55:15 +0000 (18:55 -0700)]
i965: Shorten sampler loops in precompile key setup.
Now that we have the number of samplers available, we don't need to
iterate over all 16. This should be particularly helpful for vertex
shaders.
v2: Use the correct shader program (caught by Paul Berry).
This needs to initialize the exact same set of sampler swizzles as
the actual key setup, or else we end up doing recompiles due to some
being XYZW and others being 0.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Chia-I Wu [Tue, 20 Aug 2013 03:40:49 +0000 (11:40 +0800)]
ilo: add ILO_DEBUG=flush
When specified, ilo will print a line similar to
cp flushed for render with 949+888 DWords (22.4%) because of frame end
for every ilo_cp_flush() call.
Chia-I Wu [Mon, 29 Jul 2013 05:51:56 +0000 (13:51 +0800)]
ilo: add ILO_DEBUG=draw
It can print out pipe_draw_info and the dirty bits set, useful for debugging.
Vinson Lee [Mon, 19 Aug 2013 07:43:09 +0000 (00:43 -0700)]
r600g/sb: Move memsets of member structs to within constructor bodies.
Silences "Uninitialized pointer field" defects reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
Ian Romanick [Sat, 17 Aug 2013 07:27:43 +0000 (00:27 -0700)]
glsl: Use alignment of container record for its first field
The first field of a record in a UBO has the aligment of the record
itself.
Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
the piglit list that extends the test) layout-std140.
NOTE: The bit of strangeness with the version of visit_field without the
record_type poitner is because that method is pure virtual in the base
class. The original implementation of the class did this to ensure
derived classes remembered to implement that flavor. Now they can
implement either flavor but not both. I don't know a C++ way to enforce
that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
Ian Romanick [Sat, 17 Aug 2013 06:30:43 +0000 (23:30 -0700)]
glsl: Add new overload of program_resource_visitor::visit_field method
The outer-most record is passed into the visit_field method for
the first field. In other words, in the following structure:
struct S1 {
vec4 v;
float f;
};
struct S {
S1 s1;
S1 s2;
};
uniform Ubo {
S s;
};
s.s1.v would get record_type = S (because s1.v is the first non-record
field in S), and s.s2.v would get record_type = S1. s.s1.f and s.s2.f
would get record_type = NULL becuase they aren't the first field of
anything.
This new overload isn't used yet, but the next patch will add several
uses.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
Ian Romanick [Tue, 13 Aug 2013 16:15:01 +0000 (09:15 -0700)]
glsl: Disallow embedded structure definitions
Continue to allow them in GLSL 1.10 because the spec allows it.
Generate an error in all other versions because the specs specifically
disallow it.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 23:25:17 +0000 (16:25 -0700)]
meta: Add default precision qualifier to all fragement shaders
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 22:02:49 +0000 (15:02 -0700)]
glsl: Add default precision qualifiers for ES builtins
Once the compiler proplerly checks for default precision qualifiers,
these shaders will cease to compile.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Ian Romanick [Fri, 9 Aug 2013 20:44:49 +0000 (13:44 -0700)]
glsl: Remove extra "types" from error message
Send it straight to the Department of Redundancy Department.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 15 Aug 2013 03:18:24 +0000 (20:18 -0700)]
i965: Make the VS binding table as small as possible.
For some reason, we didn't use this information even though the VS
backend has computed it (albeit poorly) for ages.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Thu, 15 Aug 2013 03:25:40 +0000 (20:25 -0700)]
i965/vs: Rework binding table size calculation.
Unlike the FS, the VS backend already computed the binding table size.
However, it did so poorly: after compilation, it looked to see if any
pull constants/textures/UBOs were in use, and set num_surfaces to the
maximum surface index for that category. If the VS only used a single
texture or UBO, this overcounted by quite a bit.
The shader time surface was also noted at state upload time (during
drawing), not at compile time, which is inefficient. I believe it also
had an off by one error.
This patch computes it accurately, while also simplifying the code.
It also renames num_surfaces to binding_table_size, since num_surfaces
wasn't actually the number of surfaces used. For example, a VS that
used one UBO and no other surfaces would have set num_surfaces to
SURF_INDEX_VS_UBO(1) == 18, rather than 1. A bit of a misnomer there.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Thu, 15 Aug 2013 03:42:29 +0000 (20:42 -0700)]
i965/vs: Plumb brw_vec4_prog_data into vec4_generator().
This will be useful for the next commit.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Thu, 15 Aug 2013 02:54:25 +0000 (19:54 -0700)]
i965/fs: Make the FS binding table as small as possible.
Computing the minimum size was easy, and done at compile-time for no
extra overhead here. Making the binding table smaller wastes less batch
space.
Adding the CACHE_NEW_WM_PROG dirty bit isn't strictly necessary, since
other atoms depend on it and flag BRW_NEW_SURFACES. However, it's best
to add it for clarity and safety. It shouldn't add any new overhead.
v2: Use binding_table_size, rather than max_surface_index.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 15 Aug 2013 02:49:33 +0000 (19:49 -0700)]
i965/fs: Track the binding table size in brw_wm_prog_data.
By tracking the maximum surface index used by the shader, we know just
how small we can make the binding table.
Since it depends entirely on the shader program, we can just compute
it once at compile time, rather than at binding table emit time (which
happens during drawing).
v2: Store binding_table_size, rather than max_surface_index, for
consistency with the VS (which needs to be able to represent 0
surfaces).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 15 Aug 2013 02:43:09 +0000 (19:43 -0700)]
i965: Use SURF_INDEX_DRAW() for drawbuffer binding table indices.
SURF_INDEX_DRAW() has been the identity function since the dawn of time,
and both the shader code and binding table upload code relied on that,
simply using X rather than SURF_INDEX_DRAW(X).
Even if that continues to be true, using the macro clarifies the code.
The comment about draw buffers needing to be first in order for
headerless render target writes to work turned out to be wrong; with
this change, SURF_INDEX_DRAW can be changed to arbitrary indices and
everything continues working.
The confusion was over the "Render Target Index" field in the FB write
message header. If it were a binding table index, then RT 0 would have
to be at index 0 for headerless FB writes to work. However, it's
actually an index into the blend state table, so there's no problem.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 9 Jul 2013 22:17:15 +0000 (15:17 -0700)]
i965: Shorten sampler loops in key setup.
Now that we have the number of samplers available, we don't need to
iterate over all 16. This should be particularly helpful for vertex
shaders.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 9 Jul 2013 22:09:05 +0000 (15:09 -0700)]
i965: Make sampler counts available for the entire drawing operation.
Previously, we computed sampler counts when generating the SAMPLER_STATE
table. By computing it earlier, we should be able to shorten a bunch of
loops.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 26 Jun 2013 22:42:43 +0000 (15:42 -0700)]
i965: Split the brw_samplers atom into separate FS/VS stages.
This allows us to avoid uploading the VS sampler state table if only the
fragment program changes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 26 Jun 2013 05:14:04 +0000 (22:14 -0700)]
i965: Upload separate VS and FS sampler state tables.
Now, each shader stage has a sampler state table that only refers to the
samplers actually used by that problem. This should make the VS table
non-existant or very small.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 26 Jun 2013 05:29:19 +0000 (22:29 -0700)]
i965: Make upload_sampler_state_table a virtual function.
This allows us to coalesce the brw_samplers and gen7_samplers atoms.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 22 Aug 2012 06:54:19 +0000 (23:54 -0700)]
i965: Upload separate per-stage sampler state tables.
Also upload separate sampler default/texture border color entries.
At the moment, this is completely idiotic: both tables contain exactly
the same contents, so we're simply wasting batch space and CPU time.
However, soon we'll only upload data for textures actually /used/ in
a particular stage, which will usually make the VS table empty and
very likely eliminate all redundancy. This is just a stepping stone.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 22 Aug 2012 06:40:02 +0000 (23:40 -0700)]
i965: Un-hardcode border color table from update_sampler_state().
Like the previous patch, this simply pushes direct access to brw->wm up
one level in the call chain. Rather than passing the whole array, we
just pass a pointer to the correct spot in the array, similar to what we
do for the actual sampler state structure.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 21 Aug 2012 23:13:17 +0000 (16:13 -0700)]
i965: Un-hardcode border color table from upload_default_color.
When we begin uploading separate sampler state tables for VS and FS,
we won't be able to use &brw->wm.sdc_offset[ss_index]. By passing it in
as a parameter, we push the problem up to the caller.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 21 Aug 2012 22:24:14 +0000 (15:24 -0700)]
i965: Split sampler count variable to be per-stage.
Currently, we only have a single sampler state table shared among all
stages, so we just copy wm.sampler_count into vs.sampler_count.
In the future, each shader stage will have its own SAMPLER_STATE table,
at which point we'll need these separate sampler counts.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:54:24 +0000 (18:54 -0700)]
i965/fs: Re-enable global copy propagation.
I believe the data flow analysis actually works now, and it should be
safe to re-enable global copy propagation. It even does things now.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:44:25 +0000 (18:44 -0700)]
i965/fs: Fix computation of livein.
Since the initial value for livein is an overestimation (0xffffffff),
it's extremely likely that it will shrink, which means we can't simply
OR in new bits - we need to fully recompute it based on the current
liveout values.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:39:07 +0000 (18:39 -0700)]
i965/fs: Fully recompute liveout at each step.
Since we start with an overestimation of livein (0xffffffff), successive
steps can actually take away values. This means we can't simply OR in
new liveout values; we need to recompute it from scratch at each
iteration of the fixed-point algorithm.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:47:19 +0000 (18:47 -0700)]
i965/fs: Skip the initial block when updating livein/liveout.
The starting block always has livein = 0 and liveout = copy. Since we
start with real data, not estimates, there's no need to refine it with
the fixed point algorithm.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Mon, 12 Aug 2013 05:07:17 +0000 (22:07 -0700)]
i965/fs: Drop unnecessary and incorrect liveout initialization.
The previous commit properly initialized liveout. This previous
(and incorrect) initialization is no longer necessary.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:34:11 +0000 (18:34 -0700)]
i965/fs: Properly initialize the livein/liveout sets.
Previously, livein was initialized to 0 for all blocks. According to
the textbook, it should be the universal set (~0) for all blocks except
the one representing the start of the program (which should be 0).
liveout also needs to be initialized to COPY for the initial block.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:36:54 +0000 (18:36 -0700)]
i965/fs: Use the COPY set in the calculation for liveout.
According to page 360 of the textbook, the proper formula for liveout
is:
CPout(n) = COPY(i) union (CPin(i) - KILL(i))
Previously, we omitted COPY.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:27:22 +0000 (18:27 -0700)]
i965/fs: Simplify liveout calculation.
Excluding the existing liveout bits is a deviation from the textbook
algorithm. The reason for doing so was to determine if the value
changed, which means the fixed-point algorithm needs to run for another
iteration.
The simpler way to do that is to save the value from step (N-1) and
compare it to the new value at step N.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Fri, 9 Aug 2013 06:29:56 +0000 (23:29 -0700)]
i965/fs: Create the COPY() set for use in copy propagation dataflow.
This is the "COPY" set from Muchnick's textbook, which is necessary
to do the dataflow algorithm correctly.
v2: Simplify initialization based on Paul Berry's observation that
out_acp contains exactly what needs to be in the COPY set.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:07:45 +0000 (18:07 -0700)]
i965/fs: Rename setup_kills() to setup_initial_values().
Although this function currently only initializes the KILL set, it will
soon initialize other data flow sets as well.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 00:53:05 +0000 (17:53 -0700)]
i965/fs: Separate the updating of liveout/livein.
To compute the actual liveout/livein data flow values, we start with
some initial values and apply a fixed-point algorithm until they settle.
Previously, we iterated through all blocks, updating both liveout and
livein together in one pass. This is awkward, since computing livein
for a block requires knowing liveout for all parent blocks. Not all
of those parent blocks may have been processed yet.
This patch separates the two. First, we update liveout for all blocks.
At iteration N of the fixed-point algorithm, this uses livein values
from iteration N-1. Secondly, we update livein for all blocks. At
step N, this uses the liveout information we just computed (in step N).
This ensures each computation has a consistent picture of the data,
rather than seeing an random mix of data from steps N-1 and N depending
on the order of the blocks in the CFG data structure.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:25:36 +0000 (18:25 -0700)]
i965/fs: Rename "cont" to "progress" in dataflow algorithm.
This variable indicates that the fixed-point algorithm made changes to
the data at this step, so it needs to run for another iteration.
"progress" seems a nicer name for that.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 00:50:03 +0000 (17:50 -0700)]
i965/fs: Switch to a do-while loop in copy propagation dataflow.
The fixed-point algorithm needs to run at least once, so a do-while loop
is more natural.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Sat, 10 Aug 2013 01:51:05 +0000 (18:51 -0700)]
i965/fs: Skip global copy propagation step.
The dataflow analysis used for global copy propagation is severely
broken, and I believe it doesn't actually do anything. Fixing it will
require a lot of changes, each of which might break things.
Once all the fixes land, we can re-enable this.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Emil Velikov [Sat, 17 Aug 2013 14:38:38 +0000 (15:38 +0100)]
vl/buffers: consistent use on VL_MAX_SURFACES
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Mon, 19 Aug 2013 15:35:00 +0000 (16:35 +0100)]
st/vdpau: drop unnecessary variable prof
Any decent compiler will do this for us, although doing this
will make grepping through the code alot easier.
v2: In both mixer and query interface
v3: rebase
Reviewed-by: Christian König <christian.koenig@amd.com> [v1]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Sat, 17 Aug 2013 21:24:26 +0000 (22:24 +0100)]
vl/idct: cleanup all idct buffers
Code should loop through and cleanup the three (VL_NUM_COMPONENTS) idct
buffers, rather than doing the first one three times.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Sat, 17 Aug 2013 20:17:18 +0000 (21:17 +0100)]
vl/buffer: add sanity check after CALLOC_STRUCT
Check if we have successfully allocated memory.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Sat, 17 Aug 2013 20:45:19 +0000 (21:45 +0100)]
st/xvmc: exit gracefully if we fail to create video buffer
Free any allocated memory and return BadAlloc if create_video_buffer()
has failed to create a buffer.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 16 Aug 2013 22:10:20 +0000 (23:10 +0100)]
st/vdpau: don't try to create video buffer when the format is FORMAT_NONE
Not seen in the wild yet, but seems like a reasonable thing to do.
[suggested by Christian]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Andy Furniss [Wed, 24 Jul 2013 23:40:11 +0000 (00:40 +0100)]
vdpau/vl 422 chroma width/height mix up
I was looking into some minor 422 issues/discrepencies I noticed long
ago using vdpau on my rv790.
I noticed that there is code that is halving height rather than width -
422 is full height AFAIK.
Making the changes below doesn't actually make any noticable difference
to what I was looking into.
Maybe there are more but here's three I've found so far
Reviewed-by: Christian König <christian.koenig@amd.com>
Vinson Lee [Sat, 17 Aug 2013 22:47:50 +0000 (15:47 -0700)]
radeonsi: Ensure fmask_format is initialized in release builds.
Fixes "Uninitialized scalar variable" defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Paul Berry [Sun, 18 Aug 2013 16:19:35 +0000 (09:19 -0700)]
i965: STATIC_ASSERT that there aren't too many BRW_NEW_* flags.
We are getting close to the maximum number of BRW_NEW_* bits that can
be stored in brw->state.dirty.brw without overflowing 32 bits, and
geometry shaders are going to add more. Add a STATIC_ASSERT so that
we will be alerted when we need to switch to 64 bits.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Christian König [Mon, 15 Jul 2013 14:48:41 +0000 (08:48 -0600)]
vl: add entrypoint to is_video_format_supported
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Mon, 15 Jul 2013 14:31:25 +0000 (08:31 -0600)]
vl: add entrypoint to get_video_param
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Mon, 15 Jul 2013 09:48:04 +0000 (03:48 -0600)]
vl: rename pipe_video_decoder to pipe_video_codec
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Mon, 15 Jul 2013 08:35:37 +0000 (02:35 -0600)]
vl: rename enum pipe_video_codec to pipe_video_format
Signed-off-by: Christian König <christian.koenig@amd.com>
Christian König [Mon, 15 Jul 2013 07:50:24 +0000 (01:50 -0600)]
vl: use a template for create_video_decoder
Signed-off-by: Christian König <christian.koenig@amd.com>
Marek Olšák [Fri, 9 Aug 2013 20:34:45 +0000 (22:34 +0200)]
glsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE
Tested by examining generated TGSI shaders from piglit/glsl-routing.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
Tested-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Ilia Mirkin [Sat, 17 Aug 2013 14:53:09 +0000 (10:53 -0400)]
nv50: allow non-nv12 buffers to be created, just pass them through to vl
Since we expose non-NV12 formats as supported when there is no decoer
profile selected, make sure that those formats are actually allowed to
be allocated.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Eric Anholt [Wed, 26 Jun 2013 22:22:13 +0000 (15:22 -0700)]
dri: Choose a decent global driNConfigOptions.
Previously, we were asserting that each driver specified an NConfigOptions
exactly equal to the number of options they supplied, leading to frequent
bugs when people would forget to adjust the value when adjusting driver
options. Instead, just overallocate the table by a bit and leave sanity
checking to the assert in findOption().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 1 Aug 2013 23:53:54 +0000 (16:53 -0700)]
i965: Improve comments for driver hooks in intel_buffer_object.c.
Consistently using a "The ___ driver hook." line at the the top of each
function's comment block makes it easy to see at a glance what function
is being implemented.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Thu, 1 Aug 2013 23:14:17 +0000 (16:14 -0700)]
i965: Split intel_upload code out into a separate file.
This code upload performs batched uploads via a BO. By moving it out to
a separate file, intel_buffer_objects.c only provides the core buffer
object functionality.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Thu, 1 Aug 2013 22:35:35 +0000 (15:35 -0700)]
i965: Move GL_APPLE_object_purgeable functionality into a new file.
GL_APPLE_object_purgeable creates a mechanism for marking OpenGL objects
as "purgeable" so they can be thrown away when system resources become
scarce. It specifically applies to buffer objects, textures, and
renderbuffers.
The intel_buffer_objects.c file provides core functionality for GL
buffer objects, such as MapBufferRange and CopyBufferSubData. Having
texture and renderbuffer functionality in that file is a bit strange.
The 2010 copyright on the new file is because Chris Wilson first added
this code in January 2010 (commit
755915fa).
v2: Actually remember to call the new dd table setup function.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Marek Olšák [Sat, 17 Aug 2013 00:47:21 +0000 (02:47 +0200)]
radeonsi: fix feature support reporting
broken by
21d9a1b5ef51ce449e9a82641d0d605c5448b41c
Niels Ole Salscheider [Wed, 7 Aug 2013 15:48:48 +0000 (17:48 +0200)]
clover: Fix linkage of libOpenCL
Clover needs the option component of llvm.
Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Marek Olšák [Fri, 16 Aug 2013 13:21:45 +0000 (15:21 +0200)]
radeonsi: require LLVM 3.4 for MSAA
Marek Olšák [Fri, 9 Aug 2013 22:08:45 +0000 (00:08 +0200)]
radeonsi: don't make scanout resources linear except for cursors
The surface allocator understands the scanout flag just fine.
This seems to improve performance for Ubuntu Unity on top of st/xorg
and it fixes the cursor.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Wed, 7 Aug 2013 01:20:34 +0000 (03:20 +0200)]
radeonsi: remove useless code from tex_fetch_args
The array slice has already been added to "address".
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>