mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 12:59:58 -04:00
Forget a texture's content hash when what reached its image is not its storage: zeros for storage released mid-upload, or nothing after a failed GPU ASTC decode.
With the hash kept, the same bytes written there again were skipped as unchanged and the image stayed wrong. A texture whose decode failed is still not uploaded again until its storage is written; that part stays open. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -2347,6 +2347,8 @@ static void upload(Tex *e) {
|
|||||||
static volatile int32_t n_gone;
|
static volatile int32_t n_gone;
|
||||||
log_limited(&n_gone, "texture %#llx (%llu bytes): storage released during the upload; uploaded as zeros",
|
log_limited(&n_gone, "texture %#llx (%llu bytes): storage released during the upload; uploaded as zeros",
|
||||||
(unsigned long long)e->pub.addr, (unsigned long long)e->t.L.size);
|
(unsigned long long)e->pub.addr, (unsigned long long)e->t.L.size);
|
||||||
|
// the image holds zeros, not the bytes hashed above: the same bytes mapped back there upload again
|
||||||
|
e->chash_ok = 0;
|
||||||
}
|
}
|
||||||
if (gdsw && !sk) {
|
if (gdsw && !sk) {
|
||||||
if (held) memcpy(stg, t->mem, size);
|
if (held) memcpy(stg, t->mem, size);
|
||||||
@@ -2416,9 +2418,11 @@ static void upload(Tex *e) {
|
|||||||
e->pub.image, e->pub.aspect, rbuf);
|
e->pub.image, e->pub.aspect, rbuf);
|
||||||
perf_end(PERF_ASTC, a0);
|
perf_end(PERF_ASTC, a0);
|
||||||
vk_texstat_time(VK_TS_ASTC, a0);
|
vk_texstat_time(VK_TS_ASTC, a0);
|
||||||
if (!checked)
|
if (!checked) {
|
||||||
log_limited(&n_undecoded, "ASTC texture %#llx (fmt %#x %ux%u) not decoded on the GPU: left as it was",
|
log_limited(&n_undecoded, "ASTC texture %#llx (fmt %#x %ux%u) not decoded on the GPU: left as it was",
|
||||||
(unsigned long long)e->pub.addr, d->format, d->width, d->height);
|
(unsigned long long)e->pub.addr, d->format, d->width, d->height);
|
||||||
|
e->chash_ok = 0; // the image does not hold the bytes hashed above: the next write uploads, equal or not
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (k = k0; k < k1; k++) rg[k].bufferOffset += soff;
|
for (k = k0; k < k1; k++) rg[k].bufferOffset += soff;
|
||||||
vkCmdCopyBufferToImage(cb, sb, e->pub.image, VK_IMAGE_LAYOUT_GENERAL, k1 - k0, rg + k0);
|
vkCmdCopyBufferToImage(cb, sb, e->pub.image, VK_IMAGE_LAYOUT_GENERAL, k1 - k0, rg + k0);
|
||||||
|
|||||||
Reference in New Issue
Block a user