Repository navigation
Games cook their assets with Assetyard, with hot reload in Debug - #31
Merged
Merged
Conversation
GameApp SDK: Assets/Cooked's contents are copied next to the executable as Assets/, Assets/Raw never is, and other files in Assets/ are copied as before. Debug builds record the project's Assets/Cooked in AssemblyMetadata, so bottlenoselabs.SDL loads assets from it and reloads what assetyard watch cooks again. A message says when Assets/Raw was never cooked. bl-game template: .config/dotnet-tools.json pins Assetyard to the SDK's version, an Assets/Raw folder, Assets/Cooked/ in .gitignore, and a README section. cs-build.yml and cs-game-publish.yml cook assets first when the tool manifest has Assetyard. src/cs/games/Lava: a shader over the whole window with SDL's GPU API, for trying hot reload. GpuCommandBuffer gets PushVertexShaderUniformData and PushFragmentShaderUniformData for any unmanaged value. CI cooks the games' assets with Assetyard from source; test.sh checks the copied assets in Debug and publish, Debug's hot reload, and the template's Assetyard.
A GitHub release download failed with HTTP 618 for a moment and failed the Linux publish; retry up to 3 times on any error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 3 for assets and hot reload, after Assetyard (#29) and loading shaders with hot reload (#30).
GameApp SDK
GameAssetsDirectory, stillAssetsby default):Assets/Cooked's contents are copied next to the executable intoAssets/, so a game loadsAssets/Shaders/Sprite.frag.spv;Assets/Rawis never copied, but IDEs still show it;Assets/are copied as before, so games without Assetyard keep working;*.assetyard-tmpfiles are never copied.Assets/Cookedpath asAssemblyMetadata.bottlenoselabs.SDL(SDL: load shaders from cooked assets by name, with hot reload #30) reads it to load assets straight from there and turn hot reload on. Release builds don't have it.Assets/Rawexists but was never cooked.bl-gametemplate.config/dotnet-tools.jsonpinsbottlenoselabs.Assetyardto the SDK's own version.Assets/Raw/folder, andAssets/Cooked/in.gitignore.dotnet tool restore,dotnet assetyard cookandwatch.Reusable workflows:
cs-build.ymlandcs-game-publish.ymlrestore tools and rundotnet assetyard cookbefore building when.config/dotnet-tools.jsonhas Assetyard. Existing repositories need no workflow changes.src/cs/games/Lava: blobs of lava drawn by one fragment shader over the whole window with SDL's GPU API, given the time and the window's size. Its colors are in an include file, to try hot reload.GpuCommandBuffer.PushVertexShaderUniformData<T>andPushFragmentShaderUniformData<T>push any unmanaged value.Tests (
test.sh)Rawand aCookedfile. In Debug and in the publish folder (inside the macOS.appor Linux AppDir), it checks that the cooked and plain files are inAssets/, and thatRawandCookedaren't.Assets/Cookedwith hot reload; Release loads from next to the executable without it.DOTNET_CLI_HOME, because the .NET CLI remembers local tool paths per user.test.shpacks.Checked locally on macOS
test.shpasses, and the solution builds.assetyard watch. The Debug build foundAssets/Cookedby itself, and editingPalette.hlsliwhile it ran reloaded both shaders and rebuilt the pipeline.After merging, before releasing: nuget.org's trusted publishing policy has to allow
bottlenoselabs.Assetyard*, since newbl-gamerepositories restore it from nuget.org.