mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 04:49:57 -04:00
Sample a flat texture that a shader reads as a 3D one through a one-slice 3D copy instead of a stand-in.
Maxwell samples a texture by its own descriptor, so a 2D texture under a 3D sample gives its texel at (u, v). Vulkan has no 3D view of a 2D image, and get_view found no view for such a binding: the draw sampled a stand-in. Such a texture (plain colour, one sample, up to 1024 x 1024 texels) now gets a 3D image of one slice with all of its levels, made in the upload batch and copied again when the texture was uploaded or drawn into since, or another layer is asked for (vk_texture.c vk_texture_flat3d_locked). NX2NAVI_TEX_FLAT3D=0 gives the stand-in as before. Seen in Kakariko: two of the game's 4 x 4 RGBA8 textures are sampled as 3D textures, and each got its copy; the runs through eight reloads at 60 and 144 fps ended without errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -519,6 +519,9 @@ typedef struct {
|
||||
// the GPU is past the submission being recorded (vk_defer_free), as the replay and DLSS
|
||||
// keep pointers to render targets across a command buffer; no view of it is cached
|
||||
} VkTexImage;
|
||||
// A 2D texture a shader samples as a 3D one: its one-slice 3D copy, refreshed when its content changed (vk_texture.c);
|
||||
// NULL when it does not qualify. Texture lock held.
|
||||
const VkTexImage *vk_texture_flat3d_locked(const VkTexImage *img, uint32_t layer);
|
||||
// The window texture the backend presents (vk_backend.c): *image and *format become the float picture the game copied
|
||||
// into it, when the last draw into it was that copy and the swapchain is HDR10.
|
||||
void vk_hdr_present_source(const VkTexImage *win, VkImage *image, VkFormat *format);
|
||||
|
||||
Reference in New Issue
Block a user