Commit Graph

528 Commits

Author SHA1 Message Date
Chris Galvan cdcf8defd0 Added special case support for R8_SNORM, R16_SNORM, and R16_FLOAT
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-20 13:53:51 -06:00
Chris Galvan 0bd2083c48 Replaced array_view usage with span
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-20 10:35:22 -06:00
Chris Galvan b6b8b464d0 Use AZStd::array instead of AZStd::vector when retrieving a single pixel
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-19 16:53:59 -06:00
Chris Galvan 87651fa810 Merge branch 'development' of https://github.com/o3de/o3de into cgalvan/DraftStreamingImageAssetPixelAPI 2022-01-19 15:21:26 -06:00
dmcdiarmid-ly 8ec07031e3 Merge pull request #6959 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-15740
Support supervariants in the PrecompiledShaderBuilder
2022-01-19 12:40:22 -07:00
Chris Galvan c2b1cd1be2 Fixed bug when retrieving single pixel value
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-19 09:56:54 -06:00
santorac 45429872d6 Switched back to making MaterialAsset::GetPropertyValues automatically finalize the material asset. I realized that it's too burdensome to expect client code to call Finalize on the MaterialAsset; every code that calls GetPropertyValues would have to call Finalize(). Instead of using const_cast in GetPropertyValues like I was doing before, I just changed GetPropertyValues to be a non-const function. There were a few places in Decal code I had to update to pass non-const MaterialAsset pointers. This isn't ideal, but I think it's better than the alternatives.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 17:39:44 -08:00
Chris Galvan 948d72e079 Fixed logic error for iterating through the image data by region
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-18 16:22:25 -06:00
Chris Galvan 798f6ea5bb Added support for additional formats
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-18 15:41:37 -06:00
santorac 2627b507d3 Fixed unused variable warning
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 12:01:19 -08:00
santorac c24546a85d Fixed unused variable warning.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:30:01 -08:00
santorac 2d6d14abf7 Changed MaterialAsset::GetPropertyValues to not auto-finalize. Client code must call Finalize manually. It's better to avoid unexpected side-effects from a const getter function.
In some cases it may be acceptable to do non-const things in a const function as long as it is only manipulating internal data, and the public facing API returns the same values as before. But in this case, the IsFinalized function is a public facing API that would have a different result after GetPropertyValues was called.

I also updated a couple other minor things from code review feedback.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:56 -08:00
santorac 8084775d7a Updating code comments.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:55 -08:00
santorac aafd34679a Merged MaterialAssetCreatorCommon class into MaterialTypeAssetCreator because it is no longer needed for MaterialAssetCreator.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:53 -08:00
santorac 1fa1eaad15 Added unit tests for the new functionality.
I found a mistake where MaterialAssetCreator needs to clear the raw data when configured to finalize the material asset.
Since MaterialSourceData no longer relies on the material type source file at all, I was able to change MaterialSourceDataTest to avoid saving the source data to disk.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:49 -08:00
santorac a627cda5ae Got the unit tests working again.
I made MaterialAsset::Finalize private so I could add some parameters specifically for MaterialAssetCreator to use. Now MaterialAssetCreator::Begin has an option to finalize the material or not.
Moved MaterialAssetCreatorCommon::ValidateDataType to MaterialPropertyDescriptor as "ValidateMaterialPropertyDataType" so that MaterialAsset::Finalize could use it too

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:48 -08:00
santorac c5b128bec4 First pass at reworking and formalizing the way deferred material asset baking works. The feature basically works but needs more testing.
Before, the material builder was loading the MaterialTypeAsset and doing some processing with it, but was avoiding declaring job dependencies that would cause reprocessing lots of assets when a shader or .materialtype file changes. Reading the asset data isn't safe when not declaring a job dependency (or when declaring a weak job dependency like OrderOnce which is the case here). This caused to several known bugs.

The main change here is it no longer loads the MaterialTypeAsset at all; all other changes flow from there.

The biggest changes (when deferred material processing is enabled) are ...
1) MaterialSourceData no longer loads MaterialTypeAsset. All it really needs is to determine whether a string is an image file reference or an enum value, which is easy to do by just looking for the "." for the extension.
2) MaterialAssetCreator no longer produces a finalized material asset. It no longer uses MaterialAssetCreatorCommon because that only produces a non-finalized MaterialAsset, which has very different needs for the SetPropertyValue function. (We could consider merging MaterialAssetCreatorCommon into MaterialTypeAssetCreator since that's the only subclass at this point). And it doesn't do any validation against the properties layout since that can be done at runtime.
3) Moved processing of enum property values from MaterialSourceData to MaterialAsset::Finalize (this was the only thing being done in the builder that actually needed to read the material type asset data).

Also...
- Updated the MaterialAsset class mostly to clarify and formalize the two different modes it can be in: whether it is finalized or not.
- Merged the separate "IncludeMaterialPropertyNames" registry settings from MaterialConverterSystemComponent and MaterialBuilder into one "FinalizeMaterialAssets" setting used for both.
- Removed MaterialSourceData::ApplyVersionUpdates. Now the flow of data is the same regardless of whether the materials are finalized by the AP or at runtime. Version updates are always applied on the MaterialAsset.
- Added a validation check to MaterialTypeAssetCreator ensuring that once a property is renamed, the old name can never be used again for a new property. This assumption was already made previously, but not formalized, in that Material::FindPropertyIndex does not expect every caller to provide a version number for the material property name, also the material asset's list of raw property names was never versioned. The only way for this to be a safe assumption is to prevent reuse of old names.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2022-01-18 10:29:36 -08:00
Chris Galvan 2f0fc58318 Merge branch 'development' of https://github.com/o3de/o3de into cgalvan/DraftStreamingImageAssetPixelAPI 2022-01-18 10:09:10 -06:00
dmcdiarmid-ly 2b103ce445 Added support for supervariants to the PrecompiledShaderBuilder
Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
2022-01-17 16:52:30 -07:00
dmcdiarmid-ly 4cd3568d7b Merge pull request #6905 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-15813
Allow InstanceDatabase<Shader> to support multiple instances with different supervariants
2022-01-17 13:45:09 -07:00
dmcdiarmid-ly 1ef868437a Added supervariantIndex check in Shader::OnShaderVariantAssetReady
Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
2022-01-14 17:28:14 -07:00
Qing Tao c9ee1f7871 ATOM-17132 Image builder failed to build some images after preset was fixed (#6900)
The issue was because the preset reload was only happened in CreateJobs but not ProcessJobs. But these two functions might be called from different AssetBuilder. The fix is to add preset reload for Processjobs too.
There was another change to add debug device name for streaming image.

Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
2022-01-14 13:31:13 -08:00
moudgils d95e157f48 Different Pso cache per vendor/driver (#6893)
* Support to add a different PSO cache per vendor/driver version. Also added support to have a differnt cache for Warp

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Added a way to reset PSO cache for everyone

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Fix tabbing for one line which is failing validation

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
2022-01-14 12:24:58 -08:00
dmcdiarmid-ly 5c603882b3 Changed the Shader instanceId to the combined assetId and supervariant index
Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
2022-01-13 19:57:22 -07:00
Chris Galvan 2048d8c05c Added region-based APIs for uint and int
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-13 11:38:16 -06:00
Chris Galvan 1ed81ae973 Added API for retrieving region of streaming image asset pixel values
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-13 10:27:19 -06:00
Chris Galvan e92379e235 Merge branch 'development' of https://github.com/o3de/o3de into cgalvan/DraftStreamingImageAssetPixelAPI 2022-01-13 10:17:59 -06:00
santorac e4fe40aede Merge branch 'development' into Atom/santorac/OrderOnceDependencyForPassBuilder 2022-01-12 11:26:11 -08:00
Chris Galvan ea4bf6b7d6 Merge branch 'development' of https://github.com/o3de/o3de into cgalvan/DraftStreamingImageAssetPixelAPI 2022-01-12 11:21:45 -06:00
Chris Galvan 16bad281ae Changed GetSubImagePixelValue parameter order so x,y are first
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-11 10:40:59 -06:00
Chris Galvan e951d8fe57 Merge branch 'development' of https://github.com/o3de/o3de into cgalvan/DraftStreamingImageAssetPixelAPI 2022-01-11 10:18:16 -06:00
sphrose 0e0ca7585c change default input color space to SRGB
Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
2022-01-11 11:32:17 +00:00
michabr df7a2fbd9d Add better error handling for failed loading of the LyShine shader (#6761)
Signed-off-by: abrmich <abrmich@amazon.com>
2022-01-10 12:11:15 -08:00
Chris Galvan 8510bdbfa7 (Draft) WIP adding pixel retrieval API to StreamingImageAsset
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
2022-01-07 14:27:43 -06:00
Mike Balfour 17f928cddd Removed chatty profile markers. (#6556)
* Removed chatty profile markers.
These 4 markers removed tens of thousands of events, which reduced an example capture from 1685 ms to 1614 ms and made it far more readable.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Restored one marker

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
2021-12-23 11:53:17 -06:00
antonmic ad5f3f0e53 Merge pull request #6439 from aws-lumberyard-dev/Atom/antonmic/ClearPass
Atom/antonmic/clear pass
2021-12-16 12:12:36 -08:00
antonmic 53cf7b462b Changing all ClearPass to SlowClearPass
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-12-16 11:03:20 -08:00
antonmic 2bc381811d addressed PR feedback
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-12-16 10:42:53 -08:00
antonmic 18bb69a5cb removed unnecessary lines
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-12-15 18:37:48 -08:00
antonmic 0a8ba35738 Added ClearPass and automatic instantiation from ParentPass for slots specifying a clear action
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-12-15 18:32:59 -08:00
Tommy Walton 7188529652 Fix for GHI-4644: mesh optimization breaking skin influences (DCO fix) (#6336)
* Average incoming skin influences when multiple vertices have been welded. This is one option which will average out the weights even if two welded vertices have differing boneIds, but we probably also need to add the influences earlier in the process and enforce a process where the vertices do not get welded if they have influences with differing boneIds

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Move skin influences from MeshBuilderSkinningInfo to the vertex attribute layers so they are considered when choosing which vertices can be welded and so they are not duplicated when compatible vertices have been welded

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Updating unit tests

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Remove unused functions

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Update based on feedback from burelc

Signed-off-by: Tommy Walton <waltont@amazon.com>
2021-12-13 13:07:04 -08:00
rgba16f be0b034c43 Fix editor hang on level load (#6323)
Make View::SortFinalizedDrawLists use child jobs so they don't block the worker thread from doing other work while waiting.
Implement a TaskGraph version of the view draw list sort.
Fix a misc bug where the scene was waiting on a task graph event twice and so hanging.
Enable MeshFeatureProcessor::Simulate to be able to use jobs when no parent job is specified because the parent job is a task.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
2021-12-10 15:03:06 -06:00
moudgils 3540974b08 Multiple bug fixes (#6221)
* Multiple bug fixes
 - Handle Dx12 validation error related to multiple resource transitions happening on the same resource.
 - Added API to better query for image/buffer views associated with an attachment.
 - Address possible serialization issues by usage of size_t
 - Reduced number of Descriptor sets allowed per SRG Pool in order to reduce descriptor waste.

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Addressed minor feedback

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Fix compile issues

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Missed a few other fixes

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
2021-12-09 09:45:45 -08:00
sphrose 1a94caee47 Fix debug compilation.
Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
2021-12-08 11:06:02 +00:00
Esteban Papp 5cca52e73c Merge branch 'development' into redcode/driller_removal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Framework/AzCore/AzCore/azcore_files.cmake
#	Gems/Atom/Feature/Common/Assets/Materials/Presets/MacBeth/15_red_sRGB.tif
2021-12-07 13:31:55 -08:00
Esteban Papp cd5306febf Merging from development
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-12-07 12:35:41 -08:00
rgba16f aad16acf1f Jobify the draw item list sort in View::FinalizeDrawLists (#6176)
Jobification of the sort saves 0.7ms/frame on the HighInstanceTest on my pc.
Make MeshFeatureProcessor update of the mesh cull bounds part of the job work rather than part of the simulate work. This saves 0.1ms/frame on the HighInstanceTest

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
2021-12-07 10:44:12 -06:00
Esteban Papp 03adf700fe Merge branch 'development' into redcode/driller_removal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-12-03 13:35:16 -08:00
Esteban Papp 799cc68de2 no message
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-12-03 11:38:49 -08:00
antonmic 393c369055 Fixed pass warning in ASV
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-12-02 23:33:56 -08:00