An attempt to fix the regression

This commit is contained in:
red-prig 2024-02-19 20:02:49 +03:00
parent 97dd675031
commit 091deb5409
2 changed files with 21 additions and 9 deletions

View File

@ -1580,7 +1580,7 @@ begin
BUF_DATA_FORMAT_16 :Result:=VK_FORMAT_R16_UNORM;
BUF_DATA_FORMAT_16_16 :Result:=VK_FORMAT_R16G16_UNORM;
BUF_DATA_FORMAT_16_16_16_16:Result:=VK_FORMAT_R16G16B16A16_UNORM;
BUF_DATA_FORMAT_2_10_10_10 :Result:=VK_FORMAT_A2B10G10R10_UNORM_PACK32;
BUF_DATA_FORMAT_2_10_10_10 :Result:=VK_FORMAT_A2R10G10B10_UNORM_PACK32;
else;
end;
@ -1699,7 +1699,7 @@ begin
IMG_DATA_FORMAT_BC6 :Result:=VK_FORMAT_BC6H_UFLOAT_BLOCK;
IMG_DATA_FORMAT_BC7 :Result:=VK_FORMAT_BC7_UNORM_BLOCK;
IMG_DATA_FORMAT_2_10_10_10 :Result:=VK_FORMAT_A2B10G10R10_UNORM_PACK32;
IMG_DATA_FORMAT_2_10_10_10 :Result:=VK_FORMAT_A2R10G10B10_UNORM_PACK32;
else;
end;
@ -1711,7 +1711,12 @@ begin
IMG_DATA_FORMAT_BC1 :Result:=VK_FORMAT_BC1_RGBA_SRGB_BLOCK;
IMG_DATA_FORMAT_BC2 :Result:=VK_FORMAT_BC2_SRGB_BLOCK;
IMG_DATA_FORMAT_BC3 :Result:=VK_FORMAT_BC3_SRGB_BLOCK;
IMG_DATA_FORMAT_BC4 :Result:=VK_FORMAT_BC4_UNORM_BLOCK;
IMG_DATA_FORMAT_BC5 :Result:=VK_FORMAT_BC5_UNORM_BLOCK;
IMG_DATA_FORMAT_BC6 :Result:=VK_FORMAT_BC6H_UFLOAT_BLOCK;
IMG_DATA_FORMAT_BC7 :Result:=VK_FORMAT_BC7_SRGB_BLOCK;
IMG_DATA_FORMAT_2_10_10_10 :Result:=VK_FORMAT_A2R10G10B10_UNORM_PACK32;
else;
end;

View File

@ -1617,7 +1617,7 @@ const
VK_IMAGE_USAGE_DEFAULT or
ord(VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
function VK_IMAGE_USAGE_DEFAULT_COLOR(cformat:TVkFormat):TVkFlags;
function VK_IMAGE_USAGE_DEFAULT_COLOR(cformat:TVkFormat;rt:Boolean):TVkFlags;
begin
Case cformat of
VK_FORMAT_R4G4_UNORM_PACK8..
@ -1636,6 +1636,13 @@ begin
Result:=VK_IMAGE_USAGE_DEFAULT or
ord(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
end;
if rt then
begin
Result:=VK_IMAGE_USAGE_DEFAULT or
ord(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
end;
end;
procedure ClearRenderTarget;
@ -1653,7 +1660,7 @@ begin
ri:=FetchImage(GFXRing.CmdBuffer,
RT_INFO.FImageInfo,
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO.FImageInfo.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO.FImageInfo.cformat,true),
TM_CLEAR
);
@ -1689,13 +1696,13 @@ begin
ri_src:=FetchImage(GFXRing.CmdBuffer,
RT_INFO_SRC.FImageInfo,
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO_SRC.FImageInfo.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO_SRC.FImageInfo.cformat,true),
{TM_READ}0
);
ri_dst:=FetchImage(GFXRing.CmdBuffer,
RT_INFO_DST.FImageInfo,
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO_DST.FImageInfo.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO_DST.FImageInfo.cformat,true),
TM_WRITE
);
@ -1969,7 +1976,7 @@ begin
ri:=FetchImage(GFXRing.CmdBuffer,
RT_INFO.FImageInfo,
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO.FImageInfo.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(RT_INFO.FImageInfo.cformat,true),
RT_INFO.IMAGE_USAGE
);
@ -2179,7 +2186,7 @@ begin
ri:=FetchImage(GFXRing.CmdBuffer,
FImage,
VK_IMAGE_USAGE_DEFAULT_COLOR(FImage.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(FImage.cformat,false),
TM_READ
);
@ -2283,7 +2290,7 @@ begin
ri:=FetchImage(GFXRing.CmdBuffer,
FImage,
VK_IMAGE_USAGE_DEFAULT_COLOR(FImage.cformat),
VK_IMAGE_USAGE_DEFAULT_COLOR(FImage.cformat,false),
TM_READ
);