Skip to content

Conversation

@kimkulling
Copy link
Owner

@kimkulling kimkulling commented Dec 17, 2025

Summary by CodeRabbit

  • Chores
    • Updated vcpkg submodule dependency to a newer version.
  • Bug Fixes
    • Shader build now places compiled shaders in platform-appropriate output locations and reports an error on unsupported platforms.
    • Shader compilation CLI still requires the --shader argument (no default); invoking without it will error.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

Updated the src/contrib/vcpkg submodule pointer and modified scripts/compile_shader.py to introduce a top-level TargetFolder variable and platform-specific shader copy behavior (Windows vs POSIX), with an error path for unknown platforms.

Changes

Cohort / File(s) Summary
Submodule update
src/contrib/vcpkg
Submodule pointer advanced from commit f75c836a to e7d7451.
Shader compile script (platform-specific copy)
scripts/compile_shader.py
Added top-level TargetFolder variable and replaced unconditional copy_shader with platform-conditional destinations: Windows (../bin/debug/shaders), POSIX (../bin/shaders), and an error message for unknown os.name.

Sequence Diagram(s)

(omitted — changes do not meet diagram generation criteria)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'vcpkg: latest greatest' is vague and uses non-descriptive marketing language that doesn't clearly convey what changed in the pull request. Use a more specific title that describes the actual changes, such as 'Update vcpkg submodule and add platform-specific shader compilation' or clarify what 'latest greatest' refers to.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add_uniform_Buffers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/compile_shader.py (1)

19-27: Fix incorrect error handling and broken error message.

The error handling has two critical issues:

  1. Incorrect error detection: communicate() returns (stdout, stderr), so checking if error is None only verifies whether stderr is empty, not whether the process succeeded. A compilation can fail with a non-zero exit code but produce no stderr output, and this would go undetected.

  2. Broken error message: Line 27 uses {error} syntax in a regular string instead of an f-string, so the error won't be displayed correctly.

Apply this diff to fix both issues:

     process_handle = subprocess.Popen(cmd, stdout=subprocess.PIPE)
     output, error = process_handle.communicate()
-    if error is None:
+    if process_handle.returncode == 0:
         print("Shader " + shadername + " compiled.")
         if verbose and output is not None:
             if len(output) != 0:
                 print(str(output))
     else:
-        print("Error {error} while compilation.", error)
+        print(f"Error {process_handle.returncode} while compilation.")
+        if error:
+            print(error.decode())
🧹 Nitpick comments (1)
scripts/compile_shader.py (1)

50-50: Simplify string slicing.

The slice path.suffix[1:len(path.suffix)] can be simplified to path.suffix[1:] since omitting the end index automatically goes to the end of the string.

Apply this diff:

-            shader_out = path.suffix[1:len(path.suffix)] + ".spv"
+            shader_out = path.suffix[1:] + ".spv"
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe81038 and feebbac.

📒 Files selected for processing (1)
  • scripts/compile_shader.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build (windows-latest, Release, cl)
  • GitHub Check: build (ubuntu-latest, Release, gcc)
  • GitHub Check: build (ubuntu-latest, Release, clang)

Changed the shader argument to be optional and added platform-specific shader copying.
@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between feebbac and cb6583c.

📒 Files selected for processing (1)
  • scripts/compile_shader.py
🧰 Additional context used
🪛 Ruff (0.14.10)
scripts/compile_shader.py

10-11: Expected an expression

(invalid-syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (windows-latest, Release, cl)

from os import listdir
from os.path import isfile, join

TargetFolder =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Invalid syntax prevents script execution.

Line 10 has an incomplete assignment statement TargetFolder = with no value, causing a syntax error that prevents the script from running. Additionally, this variable is never used elsewhere in the code.

Remove this line entirely or complete the implementation if it was intended to store the target folder path.

🔎 Proposed fix
-TargetFolder = 
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TargetFolder =
🧰 Tools
🪛 Ruff (0.14.10)

10-11: Expected an expression

(invalid-syntax)

🤖 Prompt for AI Agents
In scripts/compile_shader.py around line 10 there is an incomplete assignment
"TargetFolder =" that causes a SyntaxError and the variable is unused; either
delete this line entirely if not needed, or set it to a valid string/path (e.g.
TargetFolder = "/path/to/target") and update the rest of the script to reference
it where appropriate so the variable is actually used and no syntax error
remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants