Commit Graph

11897 Commits

Author SHA1 Message Date
Chris Burel ca297fdf38 Remove unused variables
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 21:49:43 -08:00
Chris Burel 872f2a0cfa Remove unused private class member
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 21:49:42 -08:00
Chris Burel 41be03f193 Silence warning about unnecessary lambda captures with clang
The `unused-lambda-capture` will be triggered by the following code:

```cpp
void foo(int);
int main() {
    const int i = 0;
    auto l = [i](){foo(i);};
}
```

The issue here is that reading from the constant variable `i` does not
constitute an ODR-use, and consequently the variable does not have to be
captured. See
https://github.com/llvm/llvm-project/issues/34213#issuecomment-980987311
for a related discussion.

However, MSVC sees it differently.

In order to make both compilers happy, mark this variable with
`AZ_UNUSED`, since lambda captures can't be marked with attributes like
`[[maybe_unused]]`.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 21:49:41 -08:00
Chris Burel be785dbae8 Correct the signature for the copy constructor of TestImpact::Pipe
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:35 -08:00
Chris Burel 86aa5093ec Use enable_if to control what types can instantiate a template
Using a `static_assert(false, ...)` expression in the `else` block of a
`if constexpr` statement doesn't work. The `else` block is not protected by
the `constexpr`-ness of the `if`s, so it is always compiled. Consequently
it will always fail to compile.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:34 -08:00
Chris Burel 20e268930c Correct use of the typename keyword
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:32 -08:00
Chris Burel 24339e36ab Fix non-constexpr RepoPath class to not try to be constexpr
`RepoPath` is implemented with an `AZ::IO::Path`, which is not `constexpr`.
Consequently, its constructors also cannot be `constexpr`.

This also marks the function definitions in the header as `inline`, to
avoid ODR violations.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:31 -08:00
Chris Burel 66ba970a3b Fix methods that recurse infinitely
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:30 -08:00
Chris Burel 0b133f1154 Fix format string used for size_t (should be %zu), remove unused vararg
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:29 -08:00
Chris Burel 07ce8c6e78 Remove unused functions and variables
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:27 -08:00
Chris Burel ae7f370fed Fix lambda returning false instead of nullptr
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:26 -08:00
Chris Burel 3d0a15f009 Remove AZStd::to_string(string&, bool) overload from MCore's StringConversion header
This overload has significant impact on overload resolution. Consider these
overloads:

```cpp
void to_string(AZStd::string& dest, AZStd::wstring_view src);
void to_string(string& str, bool value);
```

And then calling code like this:
```
WCHAR src[260];
AZStd::string dst;
AZStd::to_string(dst, src); // Which overload does this call?
```

If the .cpp has not included `MCore/Source/StringConversions.h`, the call
to `to_string()` will convert the `WCHAR[260]` type to a
`AZStd::wstring_view`, and call the first overload. But if
`StringConversions.h` _has_ been included, the implicit conversion of
`WCHAR[260]` to `bool` has a higher precedence, and it will be chosen
instead.

This overload was causing some uses of `to_string` in
`AnimGraph/GameController.cpp` to resolve to the wrong overload in unity
builds.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:25 -08:00
Chris Burel d4eb310950 Mark unused variables as unused
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:24 -08:00
Chris Burel bdac374775 Fix case-insensitive non-portable include paths
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:22 -08:00
Chris Burel fc2fc8459b Fix missing return; statement (this is why we use -Wunused-value)
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:21 -08:00
Chris Burel f59ac65d2c Move platform-specific variable to be inside a platform-specific #ifdef
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:20 -08:00
Chris Burel 5cc258d509 Remove unused variable
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:19 -08:00
Chris Burel b79d5faa16 Remove unused captures
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:17 -08:00
Chris Burel ddb66786dc Remove unused variable
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:16 -08:00
Chris Burel 664403c5de Mark benchmark state variables in for loops as unused in benchmarks
Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:36:15 -08:00
Chris Burel 36487c1588 Fix alignment of CONTEXT variable
The previous code had the `alignas()` in the wrong place, it needs to be
left of the typename.

Furthermore, `CONTEXT` has a default alignment of 16, so using `alignas(8)`
underaligns.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:34:56 -08:00
Chris Burel 024cbdd2cd Remove unused azSmyType variable
There's a lot of work done to set the value of this variable, but nothing
read from it.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:34:55 -08:00
Chris Burel b44c362af0 Fix comparing an array in a conditional, which is always true
Instead, check the intent of the original code, if the `szImg` string is
not empty.

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:34:54 -08:00
Chris Burel cff6fb97af Fix "expression result unused" warning
This macro was expecting that parenthesis used in the macro would be
removed during macro expansion, when they are not removed. The result was
a function call like this:

```cpp
AZ_Assert(g_SymGetSearchPath != 0, ("Can not load %s function!","SymGetSearchPath"));
```

The parenthesis cause the contents of the parenthsis to be evaluated first,
and the result is an expression using the comma operator. The comma
operator evaluates the left expression, discards the result, then
evaluates the right expression, and returns that. So the above dropping
the message, and just leaving:

```cpp
AZ_Assert(g_SymGetSearchPath != 0, "SymGetSearchPath");
```

Signed-off-by: Chris Burel <burelc@amazon.com>
2022-02-10 15:34:52 -08:00
Steve Pham 27abad7564 Fix Mac SQL Package (#7538)
* Update mac SQLite3 package to fix bad version

Signed-off-by: spham <82231385+spham-amzn@users.noreply.github.com>
2022-02-10 13:32:22 -08:00
Jeremy Ong f709ba07a9 Merge pull request #7545 from aws-lumberyard-dev/Atom/GraphicsDevMode
Introduce Atom/GraphicsDevMode settings registry key
2022-02-10 11:48:44 -07:00
dmcdiarmid-ly 0789fbfa85 Merge pull request #7544 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-17278
Fix for Vulkan startup failure on non-RT platforms
2022-02-10 11:13:06 -07:00
Mike Balfour 6791b652cc Fix memory allocation that caused benchmark runs to crash. (#7535)
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
2022-02-10 10:17:01 -06:00
SergeyAMZN a715897699 Merge pull request #7439 from aws-lumberyard-dev/TerrainMaterialsFix
LYN-8403 Prevent the same Surface Tag from getting reused
2022-02-10 15:59:24 +00:00
amzn-sj 396ec8a247 [Terrain] Optimize bulk queries to the Terrain System to retrieve height, surface weights, and normals (#7357) 2022-02-10 05:53:21 -08:00
moraaar dac3bc4ba6 Added option to disable edit button in asset widgets when there are no asset selected. (#7521)
Added new attribute "DisableEditButtonWheNoAssetSelected" to PropertyAssetCtrl. By default it's false, keeping the original behavior of leaving the edit button enabled and if it's clicked while there is no asset assigned it'll try to create a new one.

PhysX mesh asset property uses now this new feature.

Signed-off-by: moraaar moraaar@amazon.com
2022-02-10 12:23:38 +00:00
Sergey Pereslavtsev c964d2085f Removed pragma once from cpp
Signed-off-by: Sergey Pereslavtsev <pereslav@amazon.com>
2022-02-10 10:45:25 +00:00
Sergey Pereslavtsev 469fcc4fb2 Merge branch 'development' of https://github.com/o3de/o3de into TerrainMaterialsFix 2022-02-10 10:40:38 +00:00
Jeremy Ong aec7b58c39 Introduce Atom/GraphicsDevMode settings registry key
When `"Atom": {"GraphicsDevMode": true}` is found in a `.setreg` file,
PDBs for all shaders will be emitted to their corresponding output
locations. This allows global PDB generation without needing to
explicitly modify each `.shader` file to include the `GenerateDebugInfo`
compilation option.

Signed-off-by: Jeremy Ong <jcong@amazon.com>
2022-02-10 02:27:49 -07:00
dmcdiarmid-ly 3ad7888107 Checked the device raytracing feature flag before initializing the visualization raytracing objects
Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
2022-02-09 22:11:43 -07:00
Danilo Aimini 1c3a61983a Refactor EditorEntityUiHandlerBaseto be explicitly Outliner-focused. This lays the groundwork for multiple widget-based handlers in the future. (#7443)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
2022-02-09 20:50:32 -08:00
Chris Galvan a4a1514729 Merge pull request #7509 from aws-lumberyard-dev/daimini/FocusMode/boxSelectAndManipulatorsHidingTests
Focus Mode | Create an integration test for Box Select while in Focus Mode
2022-02-09 21:44:21 -06:00
evanchia-ly-sdets 5ef2b12dca Collects failed assets on LyTestTools test failures (#7368)
* Collects failed assets on LyTestTools test failures

Signed-off-by: evanchia <evanchia@amazon.com>

* Changed query to all lines because of current asset logging bug

Signed-off-by: evanchia <evanchia@amazon.com>

* fixes per pr feedback

Signed-off-by: evanchia <evanchia@amazon.com>

* testing removing change for AR failure

Signed-off-by: evanchia <evanchia@amazon.com>

* Moved asset log artifact collection to after the results have been collected

Signed-off-by: evanchia <evanchia@amazon.com>

* Adding debug line to help debug AR failure

Signed-off-by: evanchia <evanchia@amazon.com>

* Made asset log collection non failing

Signed-off-by: evanchia <evanchia@amazon.com>

* moved asset log collection after test result collection

Signed-off-by: evanchia <evanchia@amazon.com>

* changed asset saving to non failing

Signed-off-by: evanchia <evanchia@amazon.com>

* improved logging and comments

Signed-off-by: evanchia <evanchia@amazon.com>
2022-02-09 18:13:01 -08:00
Luis Sempé cdedd38767 Merge pull request #7523 from aws-lumberyard-dev/scripting/xfail_tests
Disabled tests that are reported failing on nightly builds
2022-02-09 16:21:49 -08:00
Ken Pruiksma dc5d50a4ce Terrain default surface material (#7481)
Terrain default surface material
This adds the ability to set a default material on detail material regions as a fallback material for when there are no materials for an assigned surface tag, or there's only one surface tag but its weight is less than 1.0.

This also fixes some issues
- The terrain surface list component now correctly sends notifications on tag changes.
- The terrain area material notifications bus now has two separate change notifications - one for material, the other for tag
- The terrain renderer will now only consider a single region per point queried instead of any region that might have a matching surface tag.
2022-02-09 17:41:38 -06:00
michabr e5800d738a Fix position of newly created UI element (#7510)
Signed-off-by: abrmich <abrmich@amazon.com>
2022-02-09 15:27:53 -08:00
carlitosan 51bac9a6c0 remove code that loads member variables on SC editor component twice (#7506)
* remove code that loads member variables on SC editor component twice

Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>

* fix unused variable release build error

Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>
2022-02-09 14:45:56 -08:00
Benjamin Jillich caae0b0ec3 Motion Matching: Fix for test build on nightly linux builds (#7522)
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
2022-02-09 16:18:19 -06:00
Chris Galvan daee055a97 Merge pull request #7526 from aws-lumberyard-dev/cgalvan/ImproveImageGradientGetValuesPerformance
Improved image gradient GetValue(s) performance by using cached image data
2022-02-09 16:11:45 -06:00
Mike Balfour f79fa57b4a Fix race condition crash with the gradient preview. (#7530)
When duplicating an entity with a Gradient SurfaceData Component, it's possible to get a hang/crash due to a race condition between entity deactivation and the gradient preview job refresh. This change ensures that the preview job is canceled on deactivation.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
2022-02-09 16:09:08 -06:00
Chris Galvan 2e762ba0eb Modified activate logic from PR feedback
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-02-09 14:35:34 -06:00
Sean Sweeney 2a977510de Merge pull request #7527 from aws-lumberyard-dev/physics_fix
Prevent unsafe calls to AssetProcessor
2022-02-09 12:21:14 -08:00
sweeneys f5463bd903 Prevent unsafe calls to AssetProcessor
Signed-off-by: sweeneys <sweeneys@amazon.com>
2022-02-09 10:40:11 -08:00
carlitosan f74e980659 fix errors when generic nodes fail to add slots (#7508)
Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>
2022-02-09 10:23:16 -08:00
Chris Galvan 2f3c4d37df Improved image gradient GetValue(s) performance by using cached image data
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-02-09 12:22:38 -06:00