This commit is contained in:
Pavel 2022-10-07 12:51:14 +03:00
parent b1a56681cb
commit dcfd378fe3
3 changed files with 24 additions and 19 deletions

View File

@ -1450,8 +1450,9 @@ begin
IMG_DATA_FORMAT_16_16 :Result:=VK_FORMAT_R16_UNORM;
IMG_DATA_FORMAT_16_16_16_16:Result:=VK_FORMAT_R16G16B16A16_UNORM;
IMG_DATA_FORMAT_5_6_5 :Result:=VK_FORMAT_R5G6B5_UNORM_PACK16;
IMG_DATA_FORMAT_4_4_4_4 :Result:=VK_FORMAT_R4G4B4A4_UNORM_PACK16;
IMG_DATA_FORMAT_BC1 :Result:=VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
IMG_DATA_FORMAT_BC3 :Result:=VK_FORMAT_BC3_UNORM_BLOCK
IMG_DATA_FORMAT_BC3 :Result:=VK_FORMAT_BC3_UNORM_BLOCK;
else
Assert(false,_get_tex_dfmt_str(PT^.dfmt));
end;
@ -1462,7 +1463,7 @@ begin
IMG_DATA_FORMAT_8_8 :Result:=VK_FORMAT_R8G8_SRGB;
IMG_DATA_FORMAT_8_8_8_8 :Result:=VK_FORMAT_R8G8B8A8_SRGB;
IMG_DATA_FORMAT_BC1 :Result:=VK_FORMAT_BC1_RGBA_SRGB_BLOCK;
IMG_DATA_FORMAT_BC3 :Result:=VK_FORMAT_BC3_SRGB_BLOCK
IMG_DATA_FORMAT_BC3 :Result:=VK_FORMAT_BC3_SRGB_BLOCK;
else
Assert(false,_get_tex_dfmt_str(PT^.dfmt));
end;

View File

@ -715,6 +715,9 @@ begin
stat^.st_mtim:=filetime_to_timespec(hfi.ftLastWriteTime);
stat^.st_ctim:=stat^.st_mtim;
stat^.st_birthtim:=filetime_to_timespec(hfi.ftCreationTime);
stat^.st_blocks :=((stat^.st_size+511) div 512);
stat^.st_blksize :=512;
end;
else

View File

@ -175,36 +175,37 @@ begin
Result:=0;
Case cformat of
//pixel size
VK_FORMAT_R8G8B8A8_SRGB :Result:=4;
VK_FORMAT_R8G8B8A8_UNORM :Result:=4;
VK_FORMAT_R8G8_UNORM :Result:=2;
VK_FORMAT_R8_UNORM :Result:=1;
VK_FORMAT_R8_UINT :Result:=1;
VK_FORMAT_R8_SRGB :Result:=1;
VK_FORMAT_R5G6B5_UNORM_PACK16 :Result:=2;
VK_FORMAT_R32_SFLOAT :Result:=4;
VK_FORMAT_R8G8B8A8_SRGB :Result:=4;
VK_FORMAT_R8G8B8A8_UNORM :Result:=4;
VK_FORMAT_R8G8_UNORM :Result:=2;
VK_FORMAT_R8_UNORM :Result:=1;
VK_FORMAT_R8_UINT :Result:=1;
VK_FORMAT_R8_SRGB :Result:=1;
VK_FORMAT_R5G6B5_UNORM_PACK16 :Result:=2;
VK_FORMAT_R4G4B4A4_UNORM_PACK16:Result:=2;
VK_FORMAT_R32_SFLOAT :Result:=4;
//stencil
VK_FORMAT_S8_UINT :Result:=1;
VK_FORMAT_S8_UINT :Result:=1;
//depth
VK_FORMAT_D16_UNORM :Result:=2;
VK_FORMAT_X8_D24_UNORM_PACK32 :Result:=4;
VK_FORMAT_D32_SFLOAT :Result:=4;
VK_FORMAT_D16_UNORM :Result:=2;
VK_FORMAT_X8_D24_UNORM_PACK32 :Result:=4;
VK_FORMAT_D32_SFLOAT :Result:=4;
//depth stencil
VK_FORMAT_D16_UNORM_S8_UINT :Result:=3;
VK_FORMAT_D24_UNORM_S8_UINT :Result:=4;
VK_FORMAT_D32_SFLOAT_S8_UINT :Result:=5;
VK_FORMAT_D16_UNORM_S8_UINT :Result:=3;
VK_FORMAT_D24_UNORM_S8_UINT :Result:=4;
VK_FORMAT_D32_SFLOAT_S8_UINT :Result:=5;
//texel size
VK_FORMAT_BC1_RGB_UNORM_BLOCK..
VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
VK_FORMAT_BC4_UNORM_BLOCK..
VK_FORMAT_BC4_SNORM_BLOCK :Result:=8;
VK_FORMAT_BC4_SNORM_BLOCK :Result:=8;
VK_FORMAT_BC2_UNORM_BLOCK..
VK_FORMAT_BC3_SRGB_BLOCK,
VK_FORMAT_BC5_UNORM_BLOCK..
VK_FORMAT_BC7_SRGB_BLOCK :Result:=16;
VK_FORMAT_BC7_SRGB_BLOCK :Result:=16;
else
Assert(false,'TODO');