[PR #7841] Shader packs: resolve legacy texture-size queries #7856

Open
opened 2026-11-03 07:25:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7841
Author: @gigamans442
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/legacy-texture-size-20261102


📝 Commits (1)

  • 4eb4b71 Shader packs: resolve legacy texture-size queries

📊 Changes

2 files changed (+286 additions, -0 deletions)

View changed files

📝 crates/horizon-shaders/src/translate/rewrite.rs (+53 -0)
➕ crates/horizon-shaders/tests/legacy_texture_size.rs (+233 -0)

📄 Description

🤖 Opened by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally.

What and why

GLSL 1.20 packs using GL_EXT_gpu_shader4 can lose a program because the legacy textureSize1D, textureSize2D, and textureSize3D names reach Naga unchanged. Resolve these calls to the existing textureSize built-in when the known sampler has the matching dimension. Keep pack-defined functions/prototypes and macro expansions intact, and keep mismatched dimensions rejected.

Fixes #7826.

Kind

  • bug: a crash or a breakage

Vanilla reference

Horizon shader-pack compatibility. The public EXT_gpu_shader4 specification, section 8.7 defines the three names and integer result shapes; the GLSL 1.20 specification, section 8 defines user-function name hiding.

Other projects' code

None. This change uses the existing MIT Horizon translator, public Khronos documentation, and original synthetic fixtures. The separate converter audit ran original inputs as a black box; no converter implementation, generated helper implementation, or third-party shader-pack implementation was read or copied for this contribution.

Self-check

  • Actual public-main baseline 0bcd2f15678532560589773f674fb6290b075005: all three extension-enabled legacy cases and one original legacy 2D terrain case are skipped with unknown-function diagnostics. All three modern controls load and write both SPIR-V modules without notes.
  • Candidate: all seven exact original ZIPs load and write two SPIR-V modules each with no notes. All 158 existing shader library tests and 10 new loader/SPIR-V regressions pass; shader-crate all-target Clippy with warnings denied and workspace formatting pass. The optional external-pack integration test remains ignored. Source, executables, dependency hashes and test lists were captured within the same build lease.
  • Exact-head CI run 41535531229 passed for 4eb4b71cb7008577dfe5bf467d155254268f5a10: public-tree/history checks; 614 Python tests (one skipped); workspace formatting; workspace all-target Clippy and server no-default-features Clippy with warnings denied; workspace library/binary/integration tests and doc tests. The logs explicitly show 158 shader library tests and all 10 new regressions passing; the optional real-pack test is ignored. The launcher scope check passed with launcher compilation/tests skipped as unaffected. Parity, parity-scope, vanilla-parity and JFR jobs were skipped, not executed.
  • tools/pr_ready.py was not run: its local fallback was canceled before acquiring the shared build lease when matching CI started. The checks above are actual CI results, not a generated local self-check block.
  • No GPU pixel, gameplay, named-pack visual-parity, or rectangle/array/cube/buffer-alias claim.

🤖 Generated with Codex


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7841 **Author:** [@gigamans442](https://github.com/gigamans442) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/legacy-texture-size-20261102` --- ### 📝 Commits (1) - [`4eb4b71`](https://github.com/horizon-rust/horizon/commit/4eb4b71cb7008577dfe5bf467d155254268f5a10) Shader packs: resolve legacy texture-size queries ### 📊 Changes **2 files changed** (+286 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-shaders/src/translate/rewrite.rs` (+53 -0) ➕ `crates/horizon-shaders/tests/legacy_texture_size.rs` (+233 -0) </details> ### 📄 Description > 🤖 Opened by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally. ## What and why GLSL 1.20 packs using `GL_EXT_gpu_shader4` can lose a program because the legacy `textureSize1D`, `textureSize2D`, and `textureSize3D` names reach Naga unchanged. Resolve these calls to the existing `textureSize` built-in when the known sampler has the matching dimension. Keep pack-defined functions/prototypes and macro expansions intact, and keep mismatched dimensions rejected. Fixes #7826. ## Kind - [x] bug: a crash or a breakage ## Vanilla reference Horizon shader-pack compatibility. The public [EXT_gpu_shader4 specification, section 8.7](https://registry.khronos.org/OpenGL/extensions/EXT/EXT_gpu_shader4.txt) defines the three names and integer result shapes; the [GLSL 1.20 specification, section 8](https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.1.20.pdf) defines user-function name hiding. ## Other projects' code None. This change uses the existing MIT Horizon translator, public Khronos documentation, and original synthetic fixtures. The separate converter audit ran original inputs as a black box; no converter implementation, generated helper implementation, or third-party shader-pack implementation was read or copied for this contribution. ## Self-check - Actual public-main baseline `0bcd2f15678532560589773f674fb6290b075005`: all three extension-enabled legacy cases and one original legacy 2D terrain case are skipped with unknown-function diagnostics. All three modern controls load and write both SPIR-V modules without notes. - Candidate: all seven exact original ZIPs load and write two SPIR-V modules each with no notes. All 158 existing shader library tests and 10 new loader/SPIR-V regressions pass; shader-crate all-target Clippy with warnings denied and workspace formatting pass. The optional external-pack integration test remains ignored. Source, executables, dependency hashes and test lists were captured within the same build lease. - [Exact-head CI run 41535531229](https://github.com/horizon-rust/horizon/actions/runs/41535531229) passed for `4eb4b71cb7008577dfe5bf467d155254268f5a10`: public-tree/history checks; 614 Python tests (one skipped); workspace formatting; workspace all-target Clippy and server no-default-features Clippy with warnings denied; workspace library/binary/integration tests and doc tests. The logs explicitly show 158 shader library tests and all 10 new regressions passing; the optional real-pack test is ignored. The launcher scope check passed with launcher compilation/tests skipped as unaffected. Parity, parity-scope, vanilla-parity and JFR jobs were skipped, not executed. - `tools/pr_ready.py` was not run: its local fallback was canceled before acquiring the shared build lease when matching CI started. The checks above are actual CI results, not a generated local self-check block. - No GPU pixel, gameplay, named-pack visual-parity, or rectangle/array/cube/buffer-alias claim. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7856
No description provided.