Skip to content

Address novel errors found in -G Xcode builds#2729

Merged
jzulauf-lunarg merged 1 commit intoLunarG:devfrom
jzulauf-lunarg:zulauf-make-G-Xcode-happy
Feb 28, 2026
Merged

Address novel errors found in -G Xcode builds#2729
jzulauf-lunarg merged 1 commit intoLunarG:devfrom
jzulauf-lunarg:zulauf-make-G-Xcode-happy

Conversation

@jzulauf-lunarg
Copy link
Contributor

Was experimenting with the XCode generator to build graphics reconstruct, encountered a set of narrowing related "warnings as errors". Updated the CONVERSION_DATA_LOSS to support to easily address and patched the issues, streamlined to cast only operations for release builds. Additionally, some errors involved VkDeviceSize information narrowing through 32bit paths back to VkDeviceSize. Addressed the narrow impacts on hash seeding.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

const VkDeviceSize copy_buffer_size = draw_call_params_size * max_draw_count;

P2 Badge Keep indirect copy size multiplication in 64-bit arithmetic

Using uint32_t for draw_call_params_size causes draw_call_params_size * max_draw_count to be evaluated in 32-bit arithmetic before assignment to VkDeviceSize. When very large indirect draw counts are captured (for example, max_draw_count > UINT32_MAX / sizeof(VkDrawIndexedIndirectCommand)), copy_buffer_size can wrap, which under-allocates the cloned buffer while the generated copy regions still cover the full draw range, leading to invalid/out-of-bounds buffer copy operations during replay resource dumping.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@richard-lunarg
Copy link
Contributor

Looks pretty sane to me. The AI generated code review that suggests size_t or uint64_t for pointer math seems a reasonable tweak.

@jzulauf-lunarg jzulauf-lunarg force-pushed the zulauf-make-G-Xcode-happy branch 3 times, most recently from abab758 to 53b0a17 Compare February 27, 2026 16:31
@jzulauf-lunarg
Copy link
Contributor Author

@richard-lunarg @mikes-lunarg -- review/approve?

@jzulauf-lunarg jzulauf-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Feb 27, 2026
@jzulauf-lunarg jzulauf-lunarg force-pushed the zulauf-make-G-Xcode-happy branch from 53b0a17 to ad89c43 Compare February 27, 2026 20:16
Copy link
Contributor

@richard-lunarg richard-lunarg left a comment

Choose a reason for hiding this comment

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

Ship it!

Which also had the potential for errors.  Fixed with an extended set of
conversion data loss checks (GFXRECON_NARROWING_*) and corrections to
types in use and function signatures.
@jzulauf-lunarg jzulauf-lunarg force-pushed the zulauf-make-G-Xcode-happy branch from ad89c43 to 3623e90 Compare February 27, 2026 22:42
@jzulauf-lunarg jzulauf-lunarg merged commit 72ae310 into LunarG:dev Feb 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants