[GH-ISSUE #7815] Shader packs: depth snapshots omit the hand and miss depth2-only readers #4605

Open
opened 2026-11-03 05:05:12 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @gigamans442 on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7815

Originally assigned to: @gigamans442 on GitHub.

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

Standard shader-pack depth snapshots can contain the wrong geometry. An original asset-free GPU fixture demonstrates two failures in current pack_post.rs:

  • With opaque depth .7 and first-person hand depth .2, a final shader sampling depth0/1/2 returns approximately (.2,.7,.7). The expected result is (.2,.2,.7): depth1 includes the opaque hand, while depth2 excludes it. Both snapshots currently copy before the hand draw.
  • With water depth .4 over opaque depth .7, no hand program and a final shader sampling only depth2, the result is .4 instead of .7. The depth2-only demand does not allocate an opaque copy and falls back to live water-containing depth. A separate depth1-only reader passes.

These failures were observed on Intel Arc A770 / Mesa26.2.4 / Vulkan using public f700231; the relevant renderer/shader source is unchanged through producer base9a0150862. Each failing case disagrees at all 256 pixels of a 16x16 target, with one RGBA8 code value tolerance. Opaque-only, water plus all-depth, and independent depth1-only controls pass. Raw original ZIPs and their opaque translator outputs produce identical failures; no external implementation or player assets were read/copied.

Expected behavior follows the public DepthTex format documentation. This concerns the standard GLSL-format path. Native shader API input proposals such as #3734 are separate. No named shader pack's visual symptom is established by this synthetic reproduction.

Further original GPU controls now confirm related depth availability failures:

  • A Deferred-only depth2 reader with an opaque hand gets .2 instead of the expected .7. Its independent Deferred depth1 control gets the expected .2, confirming that the hand drew.
  • An attached compute stage reading depth0 gets zero instead of independently seeded world depth .7. A direct fragment reader and a standalone compute reader both get .7. An earlier child in a compute-only chain also gets zero.
  • Attached compute stages reading only depth1 or depth2, with water and no hand, get .4 instead of .7. An attached all-depth reader with a hand gets (.2,.2,.2) instead of (.2,.2,.7).

These nine supplemental cases used write-only RGBA8 images, asserted all intended compute/draw pipelines built, and ran on the same Arc A770/Vulkan adapter: six failures at all 256 pixels and three passing controls. The earlier read/write-image setup attempt is excluded from depth conclusions.

An isolated water-only program case also fails: independently seeded opaque world depth .7 and water depth .4 produce RGB depth0/1/2 (.4,0,0), instead of (.4,.7,.7), at all 256 pixels. Reading all three forces the existing depth1 allocation; with no pack opaque shader, the opaque phase that should populate the copies is skipped. Its GPU build, adapter, pixel and source/executable provenance are verified. Late entity/particle geometry depth reads, rain.depth, camera history and sky behavior remain outside this issue's implementation scope.

🤖 Generated with Codex

Originally created by @gigamans442 on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7815 Originally assigned to: @gigamans442 on GitHub. > 🤖 Filed by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally. Standard shader-pack depth snapshots can contain the wrong geometry. An original asset-free GPU fixture demonstrates two failures in current `pack_post.rs`: - With opaque depth .7 and first-person hand depth .2, a final shader sampling depth0/1/2 returns approximately (.2,.7,.7). The expected result is (.2,.2,.7): depth1 includes the opaque hand, while depth2 excludes it. Both snapshots currently copy before the hand draw. - With water depth .4 over opaque depth .7, no hand program and a final shader sampling only depth2, the result is .4 instead of .7. The depth2-only demand does not allocate an opaque copy and falls back to live water-containing depth. A separate depth1-only reader passes. These failures were observed on Intel Arc A770 / Mesa26.2.4 / Vulkan using public f700231; the relevant renderer/shader source is unchanged through producer base9a0150862. Each failing case disagrees at all 256 pixels of a 16x16 target, with one RGBA8 code value tolerance. Opaque-only, water plus all-depth, and independent depth1-only controls pass. Raw original ZIPs and their opaque translator outputs produce identical failures; no external implementation or player assets were read/copied. Expected behavior follows the public [DepthTex format documentation](https://shaders.properties/current/reference/buffers/depthtex/). This concerns the standard GLSL-format path. Native shader API input proposals such as #3734 are separate. No named shader pack's visual symptom is established by this synthetic reproduction. Further original GPU controls now confirm related depth availability failures: - A Deferred-only depth2 reader with an opaque hand gets .2 instead of the expected .7. Its independent Deferred depth1 control gets the expected .2, confirming that the hand drew. - An attached compute stage reading depth0 gets zero instead of independently seeded world depth .7. A direct fragment reader and a standalone compute reader both get .7. An earlier child in a compute-only chain also gets zero. - Attached compute stages reading only depth1 or depth2, with water and no hand, get .4 instead of .7. An attached all-depth reader with a hand gets (.2,.2,.2) instead of (.2,.2,.7). These nine supplemental cases used write-only RGBA8 images, asserted all intended compute/draw pipelines built, and ran on the same Arc A770/Vulkan adapter: six failures at all 256 pixels and three passing controls. The earlier read/write-image setup attempt is excluded from depth conclusions. An isolated water-only program case also fails: independently seeded opaque world depth .7 and water depth .4 produce RGB depth0/1/2 (.4,0,0), instead of (.4,.7,.7), at all 256 pixels. Reading all three forces the existing depth1 allocation; with no pack opaque shader, the opaque phase that should populate the copies is skipped. Its GPU build, adapter, pixel and source/executable provenance are verified. Late entity/particle geometry depth reads, rain.depth, camera history and sky behavior remain outside this issue's implementation scope. 🤖 Generated with [Codex](https://openai.com/codex/)
Author
Owner

@gigamans442 commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6588758173 --> @gigamans442 commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
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#4605
No description provided.