Inactive vertex attributes are harmless to remove. Between two
consecutive stages, the input varyings must be a subset of the previous
stage's output varyings. This means removing inactive input varyings is
also harmless.
Removing inactive output varyings is not possible though. GLSL allows a
varying to not be written by the previous stage even if it's used in the
current stage (values will be undefined, but it's not an error). This
means that an inactive output varying may still need to exist as part of
the shader interface in case the following stage has that varying as
input (and is active).
Bug: angleproject:3394
Change-Id: I7302973d2b8356d9f54a66f8259c32f245a99904
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2009986
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Loose inactive samplers are already removed in
RemoveInactiveInterfaceVariables. In-struct samplers are always marked
active by CollectVariables if the uniform is active. If the uniform is
inactive, it is removed entirely by the translator. Thus no inactive
samplers are left for glslang wrapper to clean up.
Bug: angleproject:3394
Change-Id: Ic0fef052afa992bd612fd22ffa1e5b9aa72a17bc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1999488
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
With the exception of varyings, every other qualifier can be directly
output by the translator. This simplifies and optimizes glslang
wrapper.
Varyings' in/out qualifiers are still placed in @@ QUALIFIER macros so
glslang wrapper can remove them, if inactive, not by commenting them
out, but by turning them into global variables.
Bug: angleproject:3394
Change-Id: I9a3d18df2cfd36a38308bf8f71ac12f1e1513ece
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1998839
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Based on Nvidia's recommendation that the following:
all(lessThan(gl_FragCoord.xy, vec2(1.0, 1.0)))
isn't necessarily true for only a single FS invocation, even when not
multisampling. The tests that do the above are changed to compute
instead.
Bug: angleproject:3831
Change-Id: I22d935f797c2e385218bc6af31e98a7f672a7707
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2012743
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
By removing inactive uniforms in the translator, glslang wrapper doesn't
need to comment them out. Additionally, inactive uniforms don't find
their way in the default uniform block, reducing its size if there's a
mix of active and inactive uniforms.
As collateral, it also fixes a bug where inactive uniforms of struct
type were not correctly removed by glslang wrapper.
Bug: angleproject:3394
Bug: angleproject:4211
Bug: angleproject:4248
Change-Id: I874747070e875fe24bf59d39d1322e319e280a16
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1999278
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
There's no dirty bit handler if VK_EXT_transform_feedback disabled, but
we're setting that dirty bit in syncState. This results in calling a null
method pointer. Skip the invalidate if the extension is not enabled.
gl::LogMessage::~LogMessage() at ./../../third_party/angle/src/common/debug.cpp:0
rx::ContextVk::setupDraw(gl::Context const*, gl::PrimitiveMode, int, int, int, gl::DrawElementsType, void const*, angle::BitSetT<11ul, unsigned long, unsigned long>, rx::vk::priv::SecondaryCommandBuffer**) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:844
rx::ContextVk::drawArrays(gl::Context const*, gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:1698
gl::Context::drawArrays(gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/Context.inl.h:112
gl::DrawArrays(unsigned int, int, int) at ./../../third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp:926
(anonymous namespace)::AttributeLayoutNonIndexed::Draw(int, unsigned int, unsigned short const*) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:431
(anonymous namespace)::AttributeLayoutTest::Run(bool) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:305
[This stack is from the added assert; calling a null function pointer
crashes without producing a useful stack trace.]
Bug: angleproject:4326
Change-Id: I036ae322bddc4865229fa3fe7ea72a4344b99f83
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2011408
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
ARM devices cast float to unsigned int differently than Intel devices.
Need to do additional work to ensure consistent behavior.
This was causing negative API tests to fail because the invalid
parameter was being turned into a 0 which is valid, but not what was
intended (should have been 0xffffffff).
Bug: angleproject:4323
Change-Id: I7447842d0f56362d9eb2db4d04b5416c78e51d27
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2012746
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
In preparation for compiling shaders early at link time, this change
reworks line raster emulation such that it uses specialization constants
instead of a preprocessor condition. This means drawing both triangles
and lines with this program will still result in a one-time shader
compilation.
The compilation is still done at draw time in this change.
Bug: angleproject:3394
Change-Id: I0bf91398868d7f7147456533b728906b505192b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1992365
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
The non-float variations of the mix builtin were conditioned to desktop
GLSL, but they are present in ESSL 3.1+. This change also implements
constant folding of these builtins as exercised by dEQP.
Bug: angleproject:4300
Change-Id: Iec34de4cf370e00d67fd605148cd7848f9e122f8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006809
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Latest dEQP roll included some test fixes for GLES 3.1
Remove those exclusions from expectations file.
Bug: angleproject:3590
Bug: angleproject:4323
Change-Id: If08c474490c24f63d2f8cc198ee7e3dc85d7f999
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008128
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Accidentally submitted a patch set without requested changes. This
corrects the function names to 'hasRecordedCommands' and
'hasRunningCommands'.
Bug: angleproject:4029
Change-Id: I1cf3046052ace304594ef939566b0b36bae822df
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2013924
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
There are still a subset of failing tests, but the failures mentioned in angle
bug 2277 are no longer expected.
Bug: angleproject:2277
Change-Id: I6c55283911bb7be4208b41e9bcd1a4960ed5fc5a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2012948
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
There is still a failing subset, which is partially investigated in angle bugs
4329 and 4330.
Bug: angleproject:4329
Bug: angleproject:4330
Change-Id: I286bb42f521e00b3687bf327feaed47444deafc5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2010114
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
All device extension features and properties queries are now performed
in a single call for each (i.e. one for features, one for properties),
with all the extension structs chained. Then based on which feature is
present (not just whether the extension is supported), the extensions
and features are enabled.
In the process, it fixes the following issues:
- If VK_EXT_vertex_attribute_divisor is present, but the necessary
vertexAttributeInstanceRateDivisor feature is not supported, that
feature is not enabled and the emulation path is taken. Incidentally,
this also fixes an issue with renderdoc that refuses to replay captures
on such devices.
- If VK_EXT_transform_feedback is present, but the necessary
transformFeedback feature is not supported, similarly that feature is
not enabled and the emulation path is taken.
Bug: angleproject:4306
Bug: angleproject:4027
Change-Id: I0969064cba811d215c37dfe551b0ceedb334051c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2005111
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
For some reason, this wasn't implemented when texture image load and
store was implemented.
Bug: angleproject:4311
Change-Id: I24c508660ad7eb3aa944601175803751b54ce0ff
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2011324
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
The old code only unbound one image unit when a texture was deleted.
The GLES specification is clear that the texture should be unbound from
all units:
If a texture object bound to one or more image units is deleted by
DeleteTextures, it is detached from each such image unit, as though
BindImageTexture were called with unit identifying the image unit and
texture set to zero.
Bug: angleproject:4310
Change-Id: I24c508660ad7eb3aa944601175803751b54ce0dc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2011322
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
This uses the EGL_ANGLE_feature_control extension through the test
harness to control feature selection via a test config. This obviates
the need for the hacky platform methods table override.
Also adds a command graph feature that will be used to prototype the
command graph linearization for Vulkan.
Bug: angleproject:4029
Change-Id: Id37fadd5d2c317c9d9dd90dfab1fdc8e4ac3701f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2007612
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Clarifies the function for the upcoming command graph linearization.
Bug: angleproject:4029
Change-Id: Ib50997c007053757de533f69c155a92d7555e0b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003235
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Instead of referring to command graphs we can refer to if the resource
is in use by "ANGLE" or the "Driver". This will make the methods more
consistent when we switch away from the command graph.
Bug: angleproject:4029
Change-Id: I3045a4eb2a38234ef331c0662694656065590ae1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003234
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Sorted by group (i.e. blocking conformance, desktop, general Vulkan, Android).
Bug: angleproject:3520
Change-Id: I6f7c702460b3d1908838796d88e5448d4f83b242
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006018
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
dEQP queries resource limits in all formats, including float. When
INT_MAX is queried as float, the resulting value is INT_MAX+1 due to
floating point imprecision. dEQP casts this value back to int for
verification, and trips up on the resulting negative number.
This change limits every ridiculously-large limit to INT_MAX/2 instead
of INT_MAX.
Bug: angleproject:4309
Change-Id: I11018c2c5a0c8bfb410928b0a4c34c526fab2269
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006813
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Implemented DetermineBGRAReadFormatSupport in order to allow enabling
readFormat when possible with the Vulkan backend.
While reading the spec, I realized that ANGLE only seems to care
about BGRA8888 and not the new types mentioned in the extension.
Logged a new issue (http://anglebug.com/4302) to track this.
Bug: angleproject:4294
Change-Id: I071ed89574de9b4088df2301c317d3769cb31ce6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003237
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
DetermineFloatBlendSupport was added to be able to set floatBlend to
true if requirements are met. Essentially GL_EXT_float_blend complements
GL_EXT_color_buffer_float by making any non-blendable formats blendable.
Bug: angleproject:4291
Change-Id: I40d6bb7a93b8847a63de2d25c6a8dc411d6d8fbb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001479
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>