upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/tex_headers.py
diff options
context:
space:
mode:
authorOm dev <43951418+omdev74@users.noreply.github.com>2026-11-21 21:19:09 -0500
committerOm dev <43951418+omdev74@users.noreply.github.com>2026-11-21 21:19:09 -0500
commitfee6c26fa42893e617f4e84a2765d6bb95307dc5 (patch)
treef21d47610f9fd68d27060aced64d10abdc874142 /tools/tex_headers.py
parent762893fd6056c08c174a66479aed3a51739eeaa3 (diff)
Fix DDS cubemap array size
Diffstat (limited to 'tools/tex_headers.py')
-rw-r--r--tools/tex_headers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/tex_headers.py b/tools/tex_headers.py
index eb2121be5..e3f57f247 100644
--- a/tools/tex_headers.py
+++ b/tools/tex_headers.py
@@ -554,6 +554,7 @@ D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4
554 554
555 555
556def dds_header(w, h, depth=1, mips=1, fmt=28, is_cube=False, linear_size=0, array_size=1): 556def dds_header(w, h, depth=1, mips=1, fmt=28, is_cube=False, linear_size=0, array_size=1):
557 """Build a DX10 DDS header; array_size counts cubes, not faces, for cubemaps."""
557 hdr = bytearray(128) 558 hdr = bytearray(128)
558 hdr[0:4] = b"DDS " 559 hdr[0:4] = b"DDS "
559 flags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT 560 flags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT
@@ -584,8 +585,7 @@ def dds_header(w, h, depth=1, mips=1, fmt=28, is_cube=False, linear_size=0, arra
584 585
585 dim = D3D10_RESOURCE_DIMENSION_TEXTURE3D if depth > 1 else D3D10_RESOURCE_DIMENSION_TEXTURE2D 586 dim = D3D10_RESOURCE_DIMENSION_TEXTURE3D if depth > 1 else D3D10_RESOURCE_DIMENSION_TEXTURE2D
586 misc = D3D10_RESOURCE_MISC_TEXTURECUBE if is_cube else 0 587 misc = D3D10_RESOURCE_MISC_TEXTURECUBE if is_cube else 0
587 dx10_array = 6 if (is_cube and array_size == 1) else array_size 588 dxt10 = struct.pack("<IIIII", fmt, dim, misc, array_size, 0)
588 dxt10 = struct.pack("<IIIII", fmt, dim, misc, dx10_array, 0)
589 return bytes(hdr) + dxt10 589 return bytes(hdr) + dxt10
590 590
591 591