Triforce v0.8.0

Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-25 10:21:32 -06:00
parent 861702476a
commit 4fa4f9188b
881 changed files with 179428 additions and 15581 deletions

View File

@@ -50,29 +50,54 @@ struct NVNcopyRegion { int32_t xoffset=0,yoffset=0,zoffset=0,width=0,height=0,de
struct NvnState {};
union Color { float f[4]; uint32_t u[4]; };
struct nvn_p_clear_tex { const nvn_tex* tex; nvn_view view{}; bool has_view=true; NVNcopyRegion r{}; uint32_t mask=15; Color c{}; };
enum class ViewUse { Attachment };
struct TextureAttachment { VkImageView view; VkFormat format; VkImage blocks; };
unsigned selected_mip, expected_mip, first_layer, clear_count, whole_count, touched[4][4];
unsigned block_copies;
void warn(int, const char*) {}
template<typename... T> void logf(const char*,T...) {}
Texture* texture_get(const nvn_tex*,bool) { return &tex; }
int view_nvn_format(const nvn_tex*,const nvn_view*) { return 1; }
int nvn_block_size(int,int* w,int* h) { *w=*h=1; return 4; }
int nvn_block_size(int,int* w,int* h) {
const bool raw=tex.format==VK_FORMAT_BC4_UNORM_BLOCK;
*w=*h=raw ? 4 : 1;
return raw ? 8 : 4;
}
void texture_resident(Texture*,uint32_t,uint32_t,uint32_t,uint32_t,uint32_t,uint32_t,uint32_t) {}
void end_pass(VkCommandBuffer) {}
void full_barrier(VkCommandBuffer) {}
struct GprofSpan { GprofSpan(VkCommandBuffer,const char*) {} };
void texture_written(Texture* t) { t->gpu_written=true; }
''' + "\n".join(block(texture, m) for m in ("unsigned view_level(", "unsigned image_level(", "unsigned view_layer(")) + r'''
VkImageView texture_view(Texture* t,const nvn_tex*,const nvn_view* view,VkImageViewType,ViewUse) {
TextureAttachment texture_attachment(Texture* t,const nvn_tex*,const nvn_view* view) {
selected_mip=image_level(t,view_level(view)); first_layer=view_layer(view);
CHECK(view->nlevels==1 && view->nlayers==1);
return (VkImageView)1;
const bool raw=t->format==VK_FORMAT_BC4_UNORM_BLOCK;
return {(VkImageView)1,t->format,raw ? (VkImage)2 : VK_NULL_HANDLE};
}
void vkCmdCopyImage(VkCommandBuffer,VkImage src,VkImageLayout src_layout,VkImage dst,VkImageLayout dst_layout,
uint32_t count,const VkImageCopy* region) {
const bool load=block_copies%2==0;
const uint32_t slice=2+block_copies/2;
CHECK(src_layout==VK_IMAGE_LAYOUT_GENERAL && dst_layout==VK_IMAGE_LAYOUT_GENERAL && count==1);
const VkImage compressed=(VkImage)1, blocks=(VkImage)2;
CHECK(src==(load ? compressed : blocks) && dst==(load ? blocks : compressed));
CHECK(region->srcSubresource.mipLevel==(load ? 1u : 0u) && region->dstSubresource.mipLevel==(load ? 0u : 1u));
CHECK(region->srcSubresource.baseArrayLayer==0 && region->dstSubresource.baseArrayLayer==0);
CHECK(region->srcSubresource.layerCount==1 && region->dstSubresource.layerCount==1);
CHECK(region->srcOffset.z==int32_t(slice) && region->dstOffset.z==int32_t(slice));
CHECK(region->extent.width==(load ? 63u : 16u) && region->extent.height==(load ? 31u : 8u) && region->extent.depth==1);
++block_copies;
}
void vkCmdBeginRendering(VkCommandBuffer,const VkRenderingInfo* info) {
if (selected_mip != expected_mip) std::fprintf(stderr,"selected mip %u instead of %u\n",selected_mip,expected_mip);
CHECK(selected_mip==expected_mip);
CHECK(info->renderArea.extent.width==std::max(1u,tex.width>>selected_mip));
CHECK(info->renderArea.extent.height==std::max(1u,tex.height>>selected_mip));
if (tex.format==VK_FORMAT_BC4_UNORM_BLOCK) {
CHECK(block_copies==2*clear_count+1);
CHECK(info->renderArea.extent.width==16 && info->renderArea.extent.height==8);
} else {
CHECK(info->renderArea.extent.width==std::max(1u,tex.width>>selected_mip));
CHECK(info->renderArea.extent.height==std::max(1u,tex.height>>selected_mip));
}
}
void vkCmdClearAttachments(VkCommandBuffer,uint32_t,const VkClearAttachment*,uint32_t,const VkClearRect*) {
++clear_count; ++touched[selected_mip][first_layer];
@@ -82,7 +107,7 @@ void vkCmdClearColorImage(VkCommandBuffer,VkImage,VkImageLayout,const VkClearCol
CHECK(r->baseMipLevel==expected_mip); ++whole_count;
}
void vkCmdClearDepthStencilImage(VkCommandBuffer,VkImage,VkImageLayout,const VkClearDepthStencilValue*,uint32_t,const VkImageSubresourceRange*) { CHECK(false); }
''' + block(source, "struct Sub {") + ";\n" + block(source, "bool resolve(") + "\n" + block(source, "void clear_tex(") + r'''
''' + block(texture, "void copy_block_attachment(") + "\n" + block(source, "struct Sub {") + ";\n" + block(source, "bool resolve(") + "\n" + block(source, "void clear_tex(") + r'''
void run(uint32_t skip,uint32_t logical,uint32_t layer,bool whole) {
tex=Texture{}; tex.skip=skip; std::memset(touched,0,sizeof touched); clear_count=whole_count=0;
expected_mip=logical-skip;
@@ -100,7 +125,21 @@ void run(uint32_t skip,uint32_t logical,uint32_t layer,bool whole) {
int main() {
run(1,2,1,false); run(2,3,1,false); run(1,1,0,false);
run(0,2,1,false); run(0,0,0,false); run(1,2,1,true);
std::puts("PASS: 6 partial/whole clear scenarios, mip mapping and independent array layers");
tex=Texture{};
tex.type=VK_IMAGE_TYPE_3D; tex.format=VK_FORMAT_BC4_UNORM_BLOCK;
tex.width=126; tex.height=62; tex.depth=8; tex.layers=1;
expected_mip=1;
clear_count=whole_count=block_copies=0;
std::memset(touched,0,sizeof touched);
nvn_tex input;
nvn_p_clear_tex clear{&input};
clear.view.set_levels=true; clear.view.base_level=1; clear.view.nlevels=1;
clear.r={4,4,2,3,3,2};
NvnState state;
clear_tex(VK_NULL_HANDLE,state,clear);
CHECK(tex.gpu_written && clear_count==2 && whole_count==0 && block_copies==4);
CHECK(touched[1][0]==0 && touched[1][1]==0 && touched[1][2]==1 && touched[1][3]==1);
std::puts("PASS: array clears and BC volume clears preserve mip and slice addressing");
}
'''
with tempfile.TemporaryDirectory(prefix="hookshot-clear-mip-") as directory: