Fix failed 'server' platform assets on Linux related to Shaders (#4275)
* Add missing 'server' platform identifier for the ShaderBuilder * Use the current host platform as the fallback platform identifier (and not 'pc') Signed-off-by: Steve Pham <spham@amazon.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <AzslCompiler.h>
|
||||
|
||||
#include "ShaderPlatformInterfaceRequest.h"
|
||||
#include "ShaderBuilder_Traits_Platform.h"
|
||||
#include "AtomShaderConfig.h"
|
||||
|
||||
#include "SrgLayoutUtility.h"
|
||||
@@ -456,8 +457,9 @@ namespace AZ
|
||||
const uint32_t rhiUniqueIndex, const AZStd::string& platformIdentifier, const AZStd::string& shaderJsonPath,
|
||||
const uint32_t supervariantIndex, RPI::ShaderAssetSubId shaderAssetSubId)
|
||||
{
|
||||
// platform id from identifier
|
||||
AzFramework::PlatformId platformId = AzFramework::PlatformId::PC;
|
||||
// Define a fallback platform ID based on the current host platform
|
||||
AzFramework::PlatformId platformId = AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM;
|
||||
|
||||
if (platformIdentifier == "pc")
|
||||
{
|
||||
platformId = AzFramework::PlatformId::PC;
|
||||
@@ -478,6 +480,10 @@ namespace AZ
|
||||
{
|
||||
platformId = AzFramework::PlatformId::IOS;
|
||||
}
|
||||
else if (platformIdentifier == "server")
|
||||
{
|
||||
platformId = AzFramework::PlatformId::SERVER;
|
||||
}
|
||||
|
||||
uint32_t assetSubId = RPI::ShaderAsset::MakeProductAssetSubId(rhiUniqueIndex, supervariantIndex, aznumeric_cast<uint32_t>(shaderAssetSubId));
|
||||
auto assetIdOutcome = RPI::AssetUtils::MakeAssetId(shaderJsonPath, assetSubId);
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_AZSLC UNUSED_TRAIT
|
||||
#define AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM UNUSED_TRAIT
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_AZSLC "azslc"
|
||||
|
||||
#define AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM AzFramework::PlatformId::LINUX_ID
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_AZSLC "azslc"
|
||||
#define AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM AzFramework::PlatformId::MAC_ID
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_AZSLC "azslc.exe"
|
||||
#define AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM AzFramework::PlatformId::PC
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_AZSLC UNUSED_TRAIT
|
||||
#define AZ_TRAIT_ATOM_FALLBACK_ASSET_HOST_PLATFORM UNUSED_TRAIT
|
||||
|
||||
Reference in New Issue
Block a user