Skip to content

Commit

Permalink
Release 5.9.0
Browse files Browse the repository at this point in the history
* Samples
  * Added System.OnDemandRendering which showcase the new on demand rendering support. It can also be used to detect frame timing issues. (GLES2+3, Vulkan)
  * Added System.BasicRenderModelLoader which showcase how to load a mesh and render it using the BasicRender  (GLES2+3, Vulkan).
  * Updated UI.Benchmark app with on demand rendering (GLES2+3, Vulkan).
  * Much more precise frame-timing.
  * Added new command line parameter '--Version' which lists the release version and git commit (if available).
  * Added a 'license.json' for the example screenshots 'Example.jpg'
  * Initial Visual Studio 2022 support.
* Breaking changes:
  * FslResourceScan.py was integrated into 'FslBuildCheck --license' so the standalone tool was removed.
  * Replace deprecated Draw methods with the new Draw method.
  * Removed HighResolutionTimer.GetTime() use GetTimestamp() instead.
  * DemoTime now provides the higher resolution TimeSpan's as time measurements.
* Upgraded dependencies

  * FMT 8.1.1
  * RapidVulkan 1.2.189
  • Loading branch information
ReneThrane committed Jan 18, 2022
1 parent fb908cb commit 448d45c
Show file tree
Hide file tree
Showing 1,017 changed files with 20,483 additions and 1,942 deletions.
60 changes: 60 additions & 0 deletions .Config/FslBuildGen/BannedCommands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#****************************************************************************************************************************************************
# Copyright 2021 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the NXP. nor the names of
# its contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#****************************************************************************************************************************************************

class BannedCommands:
# making this list is impossible but lets just check for some obvious bad ones
Commands = [
'attrib',
'bash',
'cd',
'copy',
'cp',
'cmd',
'chown'
'chmod',
'cmd',
'dd',
'del',
'delete',
'fdisk',
'format',
'mkfs',
'mv',
'rd',
'reg',
'regedit',
'remove',
'ren',
'rm',
'wget',
]
3 changes: 3 additions & 0 deletions .Config/FslBuildGen/Build/BuildConfigRecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from typing import Optional
#from typing import Union
from FslBuildGen.Build.BuildVariantConfigUtil import BuildVariantConfigUtil
from FslBuildGen.BuildConfig.UserSetVariables import UserSetVariables
from FslBuildGen.Build.DataTypes import CommandType
#from FslBuildGen.DataTypes import BuildVariantConfig
#from FslBuildGen.ExtensionListManager import ExtensionListManager
Expand All @@ -51,6 +52,7 @@ def __init__(self,
toolVersion: Version,
platformName: str,
variantSettingsDict: Dict[str, str],
userSetVariables: UserSetVariables,
buildCommand: CommandType,
buildArgs: List[str],
runCommand: Optional[str],
Expand All @@ -60,6 +62,7 @@ def __init__(self,
self.ToolVersion = toolVersion
self.PlatformName = platformName
self.VariantSettingsDict = variantSettingsDict
self.UserSetVariables = userSetVariables
self.BuildCommand = buildCommand
self.BuildArgs = buildArgs
self.RunCommand = runCommand
Expand Down
19 changes: 16 additions & 3 deletions .Config/FslBuildGen/Build/BuildConfigureCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
class BuildConfigureCache(object):
CURRENT_VERSION = 5

def __init__(self, environmentDict: Dict[str, str], fileHashDict: Dict[str, str], commandList: List[str], platformName: str,
fslBuildVersion: str, allowFindPackage: str) -> None:
def __init__(self, environmentDict: Dict[str, str], userSetVariablesDict: Dict[str,str], fileHashDict: Dict[str, str], commandList: List[str],
platformName: str, fslBuildVersion: str, allowFindPackage: str) -> None:
super().__init__()
self.Version = BuildConfigureCache.CURRENT_VERSION
self.EnvironmentDict = environmentDict
self.UserSetVariablesDict = userSetVariablesDict
self.FileHashDict = fileHashDict
self.CommandList = commandList
self.PlatformName = platformName
Expand All @@ -62,6 +63,14 @@ def TryLoad(log: Log, cacheFilename: str) -> Optional['BuildConfigureCache']:
if jsonDict["Version"] != BuildConfigureCache.CURRENT_VERSION:
raise Exception("Unsupported version")

jsonUserSetVariablesDict = jsonDict["UserSetVariablesDict"]
finalUserSetVariablesDict = {} # type: Dict[str,str]
for key, value in jsonUserSetVariablesDict.items():
if not isinstance(key, str) or not isinstance(value, str):
raise Exception("json decode failed")
finalUserSetVariablesDict[key] = value


jsonEnvironmentDict = jsonDict["EnvironmentDict"]
finalEnvironmentDict = {} # type: Dict[str,str]
for key, value in jsonEnvironmentDict.items():
Expand All @@ -86,7 +95,7 @@ def TryLoad(log: Log, cacheFilename: str) -> Optional['BuildConfigureCache']:
platformName = jsonDict["PlatformName"] # type: str
fslBuildVersion = jsonDict["FslBuildVersion"] # type: str
allowFindPackage = jsonDict["AllowFindPackage"] # type: str
return BuildConfigureCache(finalEnvironmentDict, finalDict, finalCommandList, platformName, fslBuildVersion, allowFindPackage)
return BuildConfigureCache(finalEnvironmentDict, finalUserSetVariablesDict, finalDict, finalCommandList, platformName, fslBuildVersion, allowFindPackage)
except:
log.DoPrintWarning("Failed to decode cache file '{0}'".format(cacheFilename))
return None
Expand All @@ -103,6 +112,10 @@ def IsEqual(lhs: 'BuildConfigureCache', rhs: 'BuildConfigureCache') -> bool:
if lhs.Version != rhs.Version or len(lhs.EnvironmentDict) != len(rhs.EnvironmentDict) or len(lhs.FileHashDict) != len(rhs.FileHashDict) or len(lhs.CommandList) != len(rhs.CommandList):
return False

for key, value in lhs.UserSetVariablesDict.items():
if key not in rhs.UserSetVariablesDict or value != rhs.UserSetVariablesDict[key]:
return False

for key, value in lhs.EnvironmentDict.items():
if key not in rhs.EnvironmentDict or value != rhs.EnvironmentDict[key]:
return False
Expand Down
15 changes: 9 additions & 6 deletions .Config/FslBuildGen/Build/Builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
from FslBuildGen.Build.RequirementTree import RequirementTree
from FslBuildGen.Build.RequirementTreeNode import RequirementTreeNode
from FslBuildGen.BuildContent import ContentBuilder
from FslBuildGen.BuildConfig.BuildUtil import BuildUtil
from FslBuildGen.BuildConfig import Validate
from FslBuildGen.BuildConfig.BuildUtil import BuildUtil
from FslBuildGen.BuildConfig.UserSetVariables import UserSetVariables
from FslBuildGen.BuildContent.SharedValues import CONFIG_FSLBUILDCONTENT_ENABLED
from FslBuildGen.BuildExternal import RecipeBuilder
from FslBuildGen.BuildExternal.BuilderSettings import BuilderSettings
Expand Down Expand Up @@ -390,7 +391,7 @@ def __CreateBuildEnv(self, log: Log, buildConfig: BuildConfigRecord, buildContex
return buildEnv

def __CheckBuildConfigureModifications(self, cacheFilename: str, generatedFileSet: Set[str],
command: List[str], platformName: str, toolVersionStr: str,
userSetVariables: UserSetVariables, command: List[str], platformName: str, toolVersionStr: str,
allowFindPackage: bool, forceDirty: bool) -> Optional[BuildConfigureCache]:
"""
Generate hashes for all files in the set and compare them to the previously saved hashes
Expand All @@ -406,7 +407,7 @@ def __CheckBuildConfigureModifications(self, cacheFilename: str, generatedFileSe
for filename in generatedFileSet:
generatedFileDictCache[filename] = IOUtil.HashFile(filename)
allowFindPackageStr = "true" if allowFindPackage else "false"
configureCache = BuildConfigureCache(currentEnvironmentDict, generatedFileDictCache, command, platformName, toolVersionStr, allowFindPackageStr)
configureCache = BuildConfigureCache(currentEnvironmentDict, userSetVariables.Dict, generatedFileDictCache, command, platformName, toolVersionStr, allowFindPackageStr)

isDirty = True
self.Log.LogPrintVerbose(5, "- Loading previous configuration cache if present")
Expand Down Expand Up @@ -440,8 +441,8 @@ def __ConfigureBuild(self, report: PackageGeneratorConfigReport, buildConfig: Bu

cacheFilename = IOUtil.Join(currentWorkingDirectory, '.FslConfigureCache.json')

dirtyBuildConfigureCache = self.__CheckBuildConfigureModifications(cacheFilename, report.GeneratedFileSet, configCommand,
buildConfig.PlatformName,
dirtyBuildConfigureCache = self.__CheckBuildConfigureModifications(cacheFilename, report.GeneratedFileSet, buildConfig.UserSetVariables,
configCommand, buildConfig.PlatformName,
buildConfig.ToolVersion.ToMajorMinorPatchString(), allowFindPackage,
forceConfigure)
if dirtyBuildConfigureCache is None:
Expand Down Expand Up @@ -688,7 +689,9 @@ def BuildPackages(log: Log, configBuildDir: str, configSDKPath: str, configSDKCo
BuildVariantUtil.LogVariantSettings(log, variantSettingsDict)

requestedPackages = [] if requestedPackages is None else requestedPackages
buildConfig = BuildConfigRecord(toolConfig.ToolVersion, generatorContext.PlatformName, variantSettingsDict, buildCommand, buildArgs, buildForAllExe, generator, buildThreads)
buildConfig = BuildConfigRecord(toolConfig.ToolVersion, generatorContext.PlatformName, variantSettingsDict,
generatorContext.GeneratorInfo.VariableContext.UserSetVariables,
buildCommand, buildArgs, buildForAllExe, generator, buildThreads)

builder = Builder(log, configBuildDir, configSDKPath, configSDKConfigTemplatePath, configDisableWrite, configIsDryRun, toolConfig,
generatorContext, topLevelPackage, buildConfig, enableContentBuilder, forceClaimInstallArea, requestedPackages, forceConfigure)
Expand Down
50 changes: 50 additions & 0 deletions .Config/FslBuildGen/BuildConfig/BuildVariables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python3

#****************************************************************************************************************************************************
# Copyright 2021 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the NXP. nor the names of
# its contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#****************************************************************************************************************************************************

from typing import List

class BuildVariables(object):
# Condition
PlatformName = "PlatformName"
IsCMakeBuild = "IsCMakeBuild"
ProjectDefaultTemplate = "ProjectDefaultTemplate"
# Available in some paths
VS_TOOLSET_VERSION = "VS_TOOLSET_VERSION"

# Variables that can be set from the command line
__SetableVariabels = [VS_TOOLSET_VERSION]

@staticmethod
def GetSetableVariables() -> List[str]:
return BuildVariables.__SetableVariabels

4 changes: 3 additions & 1 deletion .Config/FslBuildGen/BuildConfig/CMakeCompileCommandsJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return self.__str__()


"""
This is used to extract information about find_package results.
"""
class CMakeCompileCommandsJson(object):
JSON_KEY_DIRECTORY = 'directory'
JSON_KEY_COMMAND = 'command'
Expand Down
40 changes: 40 additions & 0 deletions .Config/FslBuildGen/BuildConfig/LicenseConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3

#****************************************************************************************************************************************************
# Copyright 2021 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the NXP. nor the names of
# its contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#****************************************************************************************************************************************************

class LicenseConfig(object):
def __init__(self, licenseFilename: str, defaultOrigin: str, defaultLicense: str, screenshotName: str) -> None:
super().__init__()
self.LicenseFilename = licenseFilename
self.DefaultOrigin = defaultOrigin
self.DefaultLicense = defaultLicense
self.ScreenshotName = screenshotName
Loading

0 comments on commit 448d45c

Please sign in to comment.