Ilia Mirkin [Sat, 9 Jul 2016 03:28:22 +0000 (23:28 -0400)]
glsl: emit a specific error when ast_*_assign changes type
For regular ast_add, we can implicitly change either a or b's type.
However in an assignment situation, the type of the lvalue is fixed. So
if the implicit conversion logic decides to change it, it means that the
rhs's type could not be converted to the lhs type.
Emit a specific error for this rather than the rather mysterious "is not
an lvalue" error that results from having a i2f or other operation as
the lvalue.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96729
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Ilia Mirkin [Fri, 8 Jul 2016 06:44:57 +0000 (02:44 -0400)]
st/mesa: provide GL_OES_copy_image support by caching the original ETC data
The additional provision of GL_OES_copy_image is that it work for ETC.
However many desktop GPUs don't have native ETC support, so st/mesa does
the decoding by hand. Instead of discarding the compressed data, keep it
around in CPU memory. Use it when performing image copies.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Ilia Mirkin [Fri, 8 Jul 2016 03:59:03 +0000 (23:59 -0400)]
st/mesa: refactor duplicated etc fallback checks
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Ilia Mirkin [Wed, 6 Jul 2016 23:35:16 +0000 (19:35 -0400)]
glsl: look for frag data bindings with [0] tacked onto the end for arrays
The GL spec is very unclear on this point. Apparently this is discussed
without resolution in the closed Khronos bugtracker at
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=7829 . The
recommendation is to allow dropping the [0] for looking up the bindings.
The approach taken in this patch is to instead tack on [0]'s for each
arrayness level of the output's type, and doing the lookup again. That
way, for
out vec4 foo[2][2][2]
we will end up looking for bindings for foo, foo[0], foo[0][0], and
foo[0][0][0], in that order of preference.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96765
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Anholt <eric@anholt.net>
Lionel Landwerlin [Thu, 11 Aug 2016 17:25:09 +0000 (18:25 +0100)]
anv: pipeline: gen7: fix assert in debug mode
SampleMask is only 8bits long on gen7.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97278
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Haixia Shi [Fri, 12 Aug 2016 22:34:09 +0000 (15:34 -0700)]
mesa: change state query return value for RGB565
The GL_BGR and GL_UNSIGNED_SHORT_5_6_5_REV are not defined anywhere in
OpenGL ES 3.2 (or earlier) specification, and there are no known extensions
in the Khronos registry that would add these enums as valid responses for
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE) and
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT) queries.
Note that this patch does not change the bit layout returned by the query. As
defined by the GL spec, the bit layout of GL_RGB + GL_UNSIGNED_SHORT_5_6_5 and
GL_BGR + GL_UNSIGNED_SHORT_5_6_5_REV are identical.
TEST=dEQP-GLES3.functional.state_query.integers.*
Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I81bbc8ccdc7e125edaeae443baf6fa8fdefcc6b6
Anuj Phogat [Fri, 29 Jul 2016 00:37:20 +0000 (17:37 -0700)]
anv/device: Add limits for InterpolationOffset
Fixes the vulkan cts regression in test dEQP-VK.api.info.device.properties
Cc: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Thu, 11 Aug 2016 19:05:45 +0000 (12:05 -0700)]
i965: Change 8X MSAA sample mapping
This is required following the change in 8X sample positions.
Fixes the recently modified multisample-scaled-blit piglit tests.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Tue, 9 Aug 2016 22:41:24 +0000 (15:41 -0700)]
i965: Change 8x multisample positions
There are no standard sample positions defined in OpenGL and OpenGL
ES specs. Implementations have the freedom to pick the positions
which give plausible results. But the Vulkan 1.0 spec does define
standard sample positions for different sample counts. Defined
positions in Vulkan for all the sample counts except 8X match with
the positions we set in i965. We have an upcoming plan to share the
blorp code between OpenGL and Vulkan driver in near future. Keeping
the 8X sample positions same on both the drivers will help us move
in that direction.
Here is an argument by Neil Roberts (from commit
20250e85) against
any advantage of current 8X sample positions over the new ones:
"The comment above for the 8x sample positions says that the hardware
implements centroid interpolation by picking the centre-most sample
that is inside the primitive. That implies that it might be worthwhile
to pick a pattern that includes 0.5,0.5. However by experimentation
this doesn't seem to actually be the case. With the sample positions
in this patch, if I modify the piglit test below so that it instead
reports the centroid position, it reports 0.492188,0.421875 which
doesn't match any of the positions. If I modify the sample positions
so that they include one at exactly 0.5,0.5 it doesn't help and it
reports another position which is even further from the center for
some reason.
arb_gpu_shader5-interpolateAtSample-different
Kenneth Graunke experimented with some other patterns that have a
higher standard deviation but I think after some discussion it was
decided that it would be better to pick the same pattern as the other
graphics API in case there are games that rely on this pattern."
Observed no regressions in jenkins testing.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Wed, 10 Aug 2016 22:22:10 +0000 (15:22 -0700)]
anv: Use macro to avoid code duplication for sample positions
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Marek Olšák [Sun, 7 Aug 2016 00:45:30 +0000 (02:45 +0200)]
st/mesa: BufferData should flag NewDriverState
because NewDriverState is filtered depending on active shader states,
while st->dirty isn't.
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 16:38:45 +0000 (18:38 +0200)]
st/mesa: don't update atomic, SSBO, UBO and TBO states that have no effect
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 14:59:41 +0000 (16:59 +0200)]
st/mesa: _NEW_TEXTURE & CONSTANTS shouldn't flag states that aren't used
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 14:40:50 +0000 (16:40 +0200)]
st/mesa: when changing shaders, only dirty states that are affected by them
This reduces the amount of state processing that has no effect.
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 14:40:50 +0000 (16:40 +0200)]
st/mesa: determine states used or affected by shaders at compile time
At compile time, each shader determines which ST_NEW flags should be set
at shader bind time.
This just sets the new field for all shaders. The next commit will use it.
v2: small code unification
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
Marek Olšák [Tue, 2 Aug 2016 16:40:20 +0000 (18:40 +0200)]
st/mesa: remove TES/TCS/GS state dirtying optimization
This will be replaced with a better mechanism.
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 13:26:19 +0000 (15:26 +0200)]
st/mesa: don't update clip state on VS changes if it has no effect
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 2 Aug 2016 13:17:27 +0000 (15:17 +0200)]
st/mesa: don't update clip state if it has no effect
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Chad Versace [Thu, 11 Aug 2016 15:28:57 +0000 (08:28 -0700)]
mesa: Document that _mesa_enum_to_string() returns non-null (v2)
It always returns non-null, even if the number is an invalid enum.
Cc: Haixia Shi <hshi@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Change-Id: I26e8843c96130be972e66f48a49e362442e1bf97
Kenneth Graunke [Thu, 11 Aug 2016 13:12:53 +0000 (06:12 -0700)]
glsl: Fix invariant matching in GLSL 4.30 and GLSL ES 1.00.
Old languages (GLSL <= 4.20 and GLSL ES 1.00) require "invariant"
to be specified on both inputs and outputs, and match when linking.
New languages only allow outputs to be qualified as "invariant"
and remove the "invariant must match" restriction when linking
varyings (because no input can have that qualifier).
Commit
426a50e2089b12d33f5c075aa5622f64076914a3 introduced the new
behavior for ES 3.00. It also removed the "must match" restriction
for ES 1.00 shaders, which I believe is incorrect. This patch adds
that back, as well as making 4.30+ follow the new rules.
Thanks to Qiankun Miao for noticing this discrepancy.
Fixes a WebGL 2.0 conformance test when run in Chromium:
https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/qualification_order.html?webglVersion=2
Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96971
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Kenneth Graunke [Thu, 11 Aug 2016 18:44:09 +0000 (11:44 -0700)]
glsl: Tidy stream handling in merge_qualifier().
The previous commit fixed xfb_buffer handling, which was largely copy
and pasted from the stream handling. The difference is that stream
was set in input_layout_mask, so it worked.
However, that's totally rubbish: stream is only valid on geometry shader
outputs. Presumably this was to hack around inout. Instead, apply the
solution I used in the previous fix.
Really, we just need to separate shader interface and parameter
qualifier handling so this isn't a mess, but this patch at least
tidies it slightly.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Kenneth Graunke [Thu, 11 Aug 2016 18:40:25 +0000 (11:40 -0700)]
glsl: Fix inout qualifier handling in GLSL 4.40.
inout variables have q.in and q.out set. We were trying to set
xfb_buffer = 1 for shader output variables (and inadvertantly setting
it on inout parameters, too). But input_layout_mask doesn't have
xfb_buffer set, so it was seen as in invalid input qualifier.
This meant that all 'inout' parameters were broken.
Caught by running a WebGL conformance test in Chromium:
https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/qualification_order.html?webglVersion=2
Fixes Piglit's tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Miklós Máté [Sun, 26 Jun 2016 19:48:00 +0000 (13:48 -0600)]
swrast: fix active attribs with atifragshader
Only include the ones that can be used by the shader.
This fixes texture coordinates, which were completely wrong,
because WPOS was included in the list of attribs. It also
increases performance noticeably.
Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Indrajit Das [Tue, 9 Aug 2016 05:13:13 +0000 (10:43 +0530)]
st/omx/dec/h264: pass default scaling lists in raster format
Tested-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Jose Fonseca [Thu, 11 Aug 2016 13:11:00 +0000 (14:11 +0100)]
appveyor: Force Visual Studio 2013 image.
It seems the default build image is now Visual Studio 2015, and Visual
Studio 2013 is not installed.
Jose Fonseca [Thu, 11 Aug 2016 13:00:35 +0000 (14:00 +0100)]
appveyor: Install pywin32 extensions.
AppVeyor build images seem to have been upgraded to Python 2.7.12, but
no longer have pywin32 pre-installed.
Timothy Arceri [Thu, 11 Aug 2016 00:34:52 +0000 (10:34 +1000)]
glsl/tests: fix segfault in uniform initializer test
Caused by
549222f5
Tested-by: Aaron Watry <awatry@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97286
Ian Romanick [Tue, 9 Aug 2016 21:32:24 +0000 (14:32 -0700)]
glcpp: Only disallow #undef of pre-defined macros on GLSL ES >= 3.00 shaders
Section 3.4 (Preprocessor) of the GLSL ES 3.00 spec says:
It is an error to undefine or to redefine a built-in (pre-defined)
macro name.
The GLSL ES 1.00 spec does not contain this text.
Section 3.3 (Preprocessor) of the GLSL 1.30 spec says:
#define and #undef functionality are defined as is standard for C++
preprocessors for macro definitions both with and without macro
parameters.
At least as far as I can tell GCC allow '#undef __FILE__'. Furthermore,
there are desktop OpenGL conformance tests that expect '#undef
__VERSION__' and '#undef GL_core_profile' to work.
Fixes:
GL45-CTS.shaders.preprocessor.definitions.undefine_version_vertex
GL45-CTS.shaders.preprocessor.definitions.undefine_version_fragment
GL45-CTS.shaders.preprocessor.definitions.undefine_core_profile_vertex
GL45-CTS.shaders.preprocessor.definitions.undefine_core_profile_fragment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
Ian Romanick [Tue, 9 Aug 2016 21:31:49 +0000 (14:31 -0700)]
glcpp: Track the actual version instead of just the version_resolved flag
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
Timothy Arceri [Wed, 27 Jul 2016 05:20:45 +0000 (15:20 +1000)]
glsl: remove remaining tabs in link_uniform_initializers.cpp
Reviewed-by: Eric Anholt <eric@anholt.net>
Timothy Arceri [Wed, 27 Jul 2016 05:20:44 +0000 (15:20 +1000)]
glsl: use UniformHash to find storage location
There is no need to be looping over all the uniforms.
Reviewed-by: Eric Anholt <eric@anholt.net>
Timothy Arceri [Wed, 27 Jul 2016 05:20:43 +0000 (15:20 +1000)]
glsl: remove dead builtins before assigning varying locations
Builtins already have locations assigned so this shouldn't
change anything. We want to call it earlier so we can tranform
GLSL IR to NIR earlier.
Reviewed-by: Eric Anholt <eric@anholt.net>
Timothy Arceri [Wed, 27 Jul 2016 05:20:42 +0000 (15:20 +1000)]
glsl: split out varying and uniform linking code
Here a new function link_varyings_and_uniforms() is created this
should help make it easier to follow the code in link_shader()
which was getting very large.
Note the end of the new function contains a for loop with some
lowering calls that currently don't seem related to varyings or
uniforms but they are a dependancy for converting to NIR ealier
so we move things here now to keep things easy to follow.
Reviewed-by: Eric Anholt <eric@anholt.net>
Jason Ekstrand [Wed, 20 Jul 2016 19:21:41 +0000 (12:21 -0700)]
i965/vec4: Make opt_vector_float reset at the top of each block
The pass isn't really control-flow aware and you can get into case where it
tries to combine instructions from different blocks. This can actually
lead to an assertion failure when removing unneeded instructions if part of
the vector is set in one block and part in another. This prevents
regressions in the next commit.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Eric Anholt [Tue, 9 Aug 2016 07:43:15 +0000 (00:43 -0700)]
mesa: Use a temporary set to track whether we've added a resource yet.
Saves another .1s on servo.trace.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Eric Anholt [Tue, 9 Aug 2016 07:11:13 +0000 (00:11 -0700)]
prog_hash_table: Convert to using util/hash_table.h.
Improves glretrace -b servo.trace (a trace of Mozilla's servo rendering
engine booting, rendering a page, and exiting) from 1.8s to 1.1s. It uses
a large uniform array of structs, making a huge number of separate program
resources, and the fixed-size hash table was killing it. Given how many
times we've improved performance by swapping the hash table to
util/hash_table.h, just do it once and for all.
This just rebases the old hash table API on top of util/, for minimal
diff. Cleaning things up is left for later, particularly because I want
to fix up the new hash table API a little bit.
v2: Add UNUSED to the now-unused parameter.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Eric Anholt [Tue, 9 Aug 2016 07:02:44 +0000 (00:02 -0700)]
prog_hash_table: Convert compare funcs to match util/hash_table.h.
I'm going to replace this hash table with util/hash_table.h, and the first
step is to compare things the same way.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Eric Anholt [Tue, 9 Aug 2016 06:50:52 +0000 (23:50 -0700)]
nir: Drop an unused program/hash_table.h include.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Tim Rowley [Tue, 9 Aug 2016 22:23:19 +0000 (17:23 -0500)]
swr: [rasterizer core] unused variable warning fixes
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 9 Aug 2016 21:29:06 +0000 (15:29 -0600)]
swr: [rasterizer jitter] add core string to JitManager
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 9 Aug 2016 16:36:58 +0000 (10:36 -0600)]
swr: [rasterizer core] fix OOB check of viewport indices
Use correct comparison intrinsic for OOB check of viewport indices.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 9 Aug 2016 06:44:39 +0000 (00:44 -0600)]
swr: [rasterizer common] add linux definition for InterlockedAdd64
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Mon, 8 Aug 2016 23:42:42 +0000 (17:42 -0600)]
swr: [rasterizer jitter] add VMASKSTOREPS intrinsic
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Mon, 8 Aug 2016 19:57:27 +0000 (13:57 -0600)]
swr: [rasterizer jitter] add mask support for odd format fetch
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Mon, 8 Aug 2016 19:08:39 +0000 (13:08 -0600)]
swr: [rasterizer core] routing of viewport indexes through frontend
Viewport transform performed based on per-prim viewport index if available.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Sun, 7 Aug 2016 02:10:14 +0000 (20:10 -0600)]
swr: [rasterizer core] split FE and BE stats
Separated FE stats out into its own structure. There are 17 FE vs 3 BE
stat fields. Since there is only one FE thread per DC then we don't have
to loop over all threads and sum up FE stats over all the worker threads.
This also reduces size of DC since we only need to store one copy of the
FE stats and not one per worker. Finally, we can use the new FE callback
mechanism to update these.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Fri, 5 Aug 2016 22:45:41 +0000 (16:45 -0600)]
swr: [rasterizer core] remove all old stats code
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Fri, 5 Aug 2016 22:42:24 +0000 (16:42 -0600)]
swr: [rasterizer core] viewport array support
Change viewport matrix storage from AOS to SOA to support viewport arrays.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Fri, 5 Aug 2016 22:19:10 +0000 (16:19 -0600)]
swr: [rasterizer jitter] fetch support for offsetting VertexID
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Fri, 5 Aug 2016 17:17:25 +0000 (11:17 -0600)]
swr: [rasterizer core] fundamentally change how stats work
Add a per draw stats callback to update driver stats.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Thu, 4 Aug 2016 23:37:19 +0000 (17:37 -0600)]
swr: [rasterizer core] add rasterizerSampleCount to PS context
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Thu, 4 Aug 2016 19:06:49 +0000 (13:06 -0600)]
swr: [rasterizer core] remove cygwin threads.cpp stubs
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Wed, 3 Aug 2016 23:59:37 +0000 (17:59 -0600)]
swr: [rasterizer core] allow override of KNOB thread settings
- Remove HYPERTHREADED_FE support
- Add threading info as optional data passed to SwrCreateContext.
If supplied this data will override any KNOB thread settings.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Wed, 3 Aug 2016 22:40:27 +0000 (16:40 -0600)]
swr: [rasterizer core] add SwrWaitForIdleFE
This is a blocking call that waits until all FE work is complete.
This is useful for waiting for FE work to complete such as for streamout.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Wed, 3 Aug 2016 21:22:20 +0000 (15:22 -0600)]
swr: [rasterizer core] change threadsDone to be a 32-bit value.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 2 Aug 2016 21:07:24 +0000 (15:07 -0600)]
swr: [rasterizer core] update trivial accept test conditions
enable/disable raster tile trivial accept test based on scissor enable trait.
Can be optimized further.
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 2 Aug 2016 19:16:52 +0000 (13:16 -0600)]
swr: [rasterizer core] improve implementation for SoWriteOffset
1. SoWriteOffset is no longer treated as a stat
2. Added callback from core to update streamout write offset
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Tim Rowley [Tue, 2 Aug 2016 00:10:18 +0000 (18:10 -0600)]
swr: [rasterizer common] make disabled asserts always print (but not break)
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
Leo Liu [Mon, 8 Aug 2016 20:01:23 +0000 (16:01 -0400)]
vl/rbsp: add a check for emulation prevention three byte
This is the case when the "00 00 03" is very close to the beginning of
nal unit header
v2: move the check to rbsp init
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Ilia Mirkin [Fri, 1 Jul 2016 23:10:36 +0000 (19:10 -0400)]
Re-apply "glsl: don't try to lower non-gl builtins as if they were gl_FragData"
If a shader has an output array, it will get treated as though it were
gl_FragData and rewritten into gl_out_FragData instances. We only want
this to happen on the actual gl_FragData and not everything else.
This is a small part of the problem pointed out by the below bug.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96765
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Tue, 9 Aug 2016 10:58:25 +0000 (12:58 +0200)]
radeonsi: set CB_COLORn_INFO.ROUND_MODE
just do what the register spec says
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Marek Olšák [Tue, 9 Aug 2016 10:49:51 +0000 (12:49 +0200)]
radeonsi: set CB_COLORn_INFO.SIMPLE_FLOAT
This can help enable some blend optimizations (see the register spec).
Vulkan always sets this.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Marek Olšák [Tue, 9 Aug 2016 11:26:23 +0000 (13:26 +0200)]
radeonsi: disallow MIN/MAX blend equations for dual source blending
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Marek Olšák [Tue, 9 Aug 2016 10:43:13 +0000 (12:43 +0200)]
radeonsi: only set dual source blending for MRT0
This is the proper fix for Overlord and Witcher 2 hangs.
The hang condition is that 1 app must write to MRT0 and MRT1 from a pixel
shader while MRT1 is disabled in CB_TARGET_MASK (does this generate
unflushable pixel quads? I don't know), and another app (e.g. Glamor)
must enable dual source blending in both MRT0 and MRT1. The hw gets
confused, which leads to corruption and hangs.
Cc: 12.0 11.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Miklós Máté [Sun, 7 Aug 2016 22:48:31 +0000 (00:48 +0200)]
st/mesa: in ATI fs don't assume TEMP0=REG0
The temporaries are allocated dynamically.
Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Trevor Davenport [Wed, 10 Aug 2016 03:28:07 +0000 (20:28 -0700)]
st/nine: Fix invalid attempt to use indirect draws.
Since commit
6d7177f01b231e9fe79a558c28d2b562a218d7ea, radeonsi
would take a different path if info->indirect_params was not
initialized properly. Nine was not initializating this field.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Mathias Fröhlich [Sat, 6 Aug 2016 05:26:51 +0000 (07:26 +0200)]
util: Use win32 intrinsics for util_last_bit if present.
v2: Split into two patches.
v3: Fix off by one problem.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 1 Aug 2016 22:48:04 +0000 (00:48 +0200)]
gallium/radeon: use unflushed fences for deferred flushes (v2)
+23% Bioshock Infinite performance.
v2: - use the new fence_finish interface
- allow deferred fences with multiple contexts
- clear the ctx pointer after a deferred flush
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sat, 6 Aug 2016 15:00:20 +0000 (17:00 +0200)]
st/mesa: set the ctx parameter of fence_finish
for deferred flushes
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sat, 6 Aug 2016 14:41:42 +0000 (16:41 +0200)]
gallium: add a pipe_context parameter to fence_finish
required by glClientWaitSync (GL 4.5 Core spec) that can optionally flush
the context
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Fri, 5 Aug 2016 21:33:52 +0000 (23:33 +0200)]
st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT without READ_BIT (v2)
v2: keep STAGING for GL_MAP_READ_BIT
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 4 Aug 2016 23:38:23 +0000 (01:38 +0200)]
gallium/radeon: add HUD queries for mapped VRAM/GTT
mainly for monitoring visible VRAM congestion
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 4 Aug 2016 23:28:17 +0000 (01:28 +0200)]
winsys/radeon: track the amount of mapped memory
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 4 Aug 2016 23:28:17 +0000 (01:28 +0200)]
winsys/amdgpu: track the amount of mapped memory
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 4 Aug 2016 23:18:08 +0000 (01:18 +0200)]
winsys/amdgpu: don't try to unmap userptr buffers
no app calls this AFAIK
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 4 Aug 2016 14:22:59 +0000 (16:22 +0200)]
gallium/radeon: increase the size of the renderer string
Mine is longer than 64 bytes.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 4 Aug 2016 17:04:02 +0000 (19:04 +0200)]
gallium/radeon: implement ARB_clear_texture (v3)
Some ideas copied from Jakob Sinclair's implementation, but the color
clearing is completely different.
v2: remove leftover code, disable conditional rendering
disable render condition cleanly
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Mon, 8 Aug 2016 22:42:14 +0000 (00:42 +0200)]
gallium/radeon: handle render_condition_enable for clear_rt/ds
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Mon, 8 Aug 2016 22:37:39 +0000 (00:37 +0200)]
gallium: add render_condition_enable param to clear_render_target/depth_stencil
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Haixia Shi [Thu, 28 Jul 2016 17:51:12 +0000 (10:51 -0700)]
egl: android: query native window default width and height (v2)
On android platform, the width and height of a native window surface may
be updated after initialization. It is therefore necessary to query android
framework for the current width and height.
v2: remove Android specific #ifdef's and just implement the fallback directly
if the platform query_surface() callback is not provided.
TEST=dEQP-EGL.functional.resize.surface_size#* on cyan-cheets
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> (v1)
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Chad Versace <chad@kiwitree.net>
Change-Id: I673f7d2f1d90c3bf572b30f63da537f2cae1496e
Anuj Phogat [Mon, 8 Aug 2016 23:10:00 +0000 (16:10 -0700)]
anv/device: Enable sample shading on gen7+
Passes all 30 min_sample_shading tests in vulkan cts.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Mon, 8 Aug 2016 21:36:40 +0000 (14:36 -0700)]
anv/gen7_pipeline: Set multisample state using shared function
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Mon, 8 Aug 2016 21:53:48 +0000 (14:53 -0700)]
anv/pipeline: Add sample locations for gen7-7.5
V1: Add multisample positions (Nanley)
V2: Fix 8x sample positions to match OpenGL (Anuj)
V3: Vulkan has standard sample locations. They need not be same as
in OpenGL. (Anuj)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Mon, 8 Aug 2016 21:48:07 +0000 (14:48 -0700)]
anv/pipeline: Move emit_ms_state() to genX_pipeline_util.h
This will help sharing multisample state setting code.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Mathias Fröhlich [Sat, 6 Aug 2016 05:26:59 +0000 (07:26 +0200)]
gallium: Add c99_compat.h to u_bitcast.h
We need this for 'inline'.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Mathias Fröhlich [Tue, 2 Aug 2016 06:46:04 +0000 (08:46 +0200)]
util: Move _mesa_fsl/util_last_bit into util/bitscan.h
As requested with the initial creation of util/bitscan.h
now move other bitscan related functions into util.
v2: Split into two patches.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Nicolai Hähnle [Thu, 28 Jul 2016 16:01:54 +0000 (17:01 +0100)]
radeonsi: enable multi-draw related pipe caps
This enables GL_shader_draw_parameters and GL_ARB_indirect_parameters as well
as a properly accelerated implementation of GL_ARB_multi_draw_indirect.
Enabling the feature requires a sufficiently uptodate firmware -- those have
already been released a long time ago, although this does mean that the
feature only works with the amdgpu kernel module, since the radeon module
doesn't have a way to query the firmware version.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 14:00:29 +0000 (16:00 +0200)]
radeonsi: program additional multi draw parameters
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 13:54:50 +0000 (15:54 +0200)]
radeonsi: program the DRAWID SGPR
Note that for indirect draws, the new MULTI firmware packets are required.
There's also no need to reset last_{start_instance,sh_base_reg}, since
resetting last_base_vertex is sufficient.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 13:38:04 +0000 (15:38 +0200)]
radeonsi: add DRAWID parameter to vertex shaders
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 13:33:14 +0000 (15:33 +0200)]
radeonsi: wire up TGSI_SEMANTIC_BASEINSTANCE
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 15:50:42 +0000 (17:50 +0200)]
radeonsi: remove an incorrect assertion
Byte indices don't need any alignment, so remove this assertion (it got moved
into a path where a piglit test hit it during the refactoring of
commit
64ff23a58c).
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 15:06:22 +0000 (17:06 +0200)]
radeonsi: flush TC L2 cache for indirect draw data
This fixes a bug when indirect draw data is generated by transform
feedback.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Mon, 8 Aug 2016 13:54:56 +0000 (15:54 +0200)]
radeonsi/sid: add additional bits for the DRAW_(INDEX)_INDIRECT_MULTI packets
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Brian Paul [Mon, 8 Aug 2016 22:37:00 +0000 (16:37 -0600)]
st/mesa: define ST_NEW_ flags as uint64_t values, not enums
MSVC doesn't support 64-bit enum values, at least not with C code.
The compiler was warning:
c:\users\brian\projects\mesa\src\mesa\state_tracker\st_atom_list.h(43) : warning
C4309: 'initializing' : truncation of constant value
c:\users\brian\projects\mesa\src\mesa\state_tracker\st_atom_list.h(44) : warning
C4309: 'initializing' : truncation of constant value
...
And at runtime we crashed since the high 32-bits of the 'dirty' bitmask
was always 0xffffffff and the 32+u_bit_scan() index went out of bounds of
the atoms[] array.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Miklós Máté [Sat, 6 Aug 2016 21:34:00 +0000 (15:34 -0600)]
mesa: simplify ff fs generator a bit
Literally.
Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sun, 7 Aug 2016 14:24:40 +0000 (16:24 +0200)]
ddebug: dump driver states and shaders for apitrace calls
I think this was an oversight when the PIPE_DUMP flags were added.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Timothy Arceri [Fri, 5 Aug 2016 01:08:20 +0000 (11:08 +1000)]
nir: make use of nir_cf_list_extract() helper
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 22 Sep 2015 17:30:05 +0000 (10:30 -0700)]
nir: Always print non-identity swizzles.
Previously we would not print a swizzle on ssa_52 when only its .x
component is used (as seen in the definition of ssa_53):
vec3 ssa_52 = fadd ssa_51, ssa_51
vec1 ssa_53 = flog2 ssa_52
vec1 ssa_54 = flog2 ssa_52.y
vec1 ssa_55 = flog2 ssa_52.z
But this makes the interpretation of the RHS of the definition difficult
to understand and dependent on the size of the LHS. Just print swizzles
when they are not the identity swizzle, so the previous example is now
printed as:
vec3 ssa_52 = fadd ssa_51.xyz, ssa_51.xyz
vec1 ssa_53 = flog2 ssa_52.x
vec1 ssa_54 = flog2 ssa_52.y
vec1 ssa_55 = flog2 ssa_52.z
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Lionel Landwerlin [Mon, 8 Aug 2016 19:30:08 +0000 (20:30 +0100)]
anv/pipeline/gen7: Set multisample modes
Fixes the following failures :
dEQP-VK.api.copy_and_blit.resolve_image.whole_4_bit
dEQP-VK.api.copy_and_blit.resolve_image.whole_8_bit
dEQP-VK.api.copy_and_blit.resolve_image.partial_4_bit
dEQP-VK.api.copy_and_blit.resolve_image.partial_8_bit
dEQP-VK.api.copy_and_blit.resolve_image.with_regions_4_bit
dEQP-VK.api.copy_and_blit.resolve_image.with_regions_8_bit
Tested on IVB/HSW
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>