Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaders should be built by CI #688

Open
2 tasks done
Rainyan opened this issue Oct 9, 2024 · 0 comments
Open
2 tasks done

Shaders should be built by CI #688

Rainyan opened this issue Oct 9, 2024 · 0 comments
Assignees
Labels
CI Continuous Integration (GitHub Actions)

Comments

@Rainyan
Copy link
Collaborator

Rainyan commented Oct 9, 2024

Build Info

e446ed7

Description

Since we've decoupled the code repo from the binaries, we currently have a kind of clunky system for shaders authoring whereby the shader change requires:

  • PR in the code repo for code changes
  • PR in the binary repo for the built shader

This is a lot of redundant work both for the PR author and reviewers having to validate & keep both PRs in sync, and is kind of error prone (subtle errors if the wrong version of a shader was committed, producing some kind of nonobvious visual bug, etc).

Ideally, we should have a CI pipeline that triggers for changes in mp/src/materialsystem, builds all the shaders, fails the CI run on error, and finally pushes the built artifacts to the assets repo for an accepted PR. This way, we can just push the code and have the shaders generated automatically.

I have a rough sketch of this in the works, but it could look something like this:

flowchart

AR("neoAssets repo")
CR("neo repo")
L["Linux makefiles"]
C["CMakeLists"]
W["Windows makefiles"]
S["Shaders makefiles"]

CR -->|has| C
AR <-->|downloads assets from| C
C -->|generates| W
C -->|generates| S
C -->|generates| L

W -->|builds| WB["Windows build"]
L -->|builds| LB["Linux build"]
S -->|builds| SB["Shaders build"]
SB -->|pushes| AR2["neoAssets repo commit"]

WB -->|combines into| R["Release"]
AR2 -->|combines into| R
LB -->|combines into| R

Loading

To Reproduce

Write some shader code.

Expected behavior

CI attempts to build your shader code. When your PR is accepted, the shader artifacts get automatically added to the assets repo.

Actual behavior

The code/binary have to be manually kept in sync across repos.

Operating System

  • Windows
  • Linux

Version/Distro

N/A

Additional context and Screenshots

For context, here's one such pair of PRs for a shader change:

using our current workflow of:

  • Author commits code PR
  • Author builds the shader binary data
  • Author commits binary PR
  • Reviewers build the shader & review the PR
  • Reviewers validate the shader binary works correctly & matches the code PR

when ideally this could be simply:

  • Author commits code PR
  • Reviewers build the shader (or grab the generated one from CI for convenience) & review the PR
@Rainyan Rainyan added the CI Continuous Integration (GitHub Actions) label Oct 9, 2024
@Rainyan Rainyan self-assigned this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration (GitHub Actions)
Projects
Status: No status
Development

No branches or pull requests

1 participant