This commit is contained in:
Pavel 2024-10-01 10:26:41 +03:00
parent 436b43064b
commit cdf0418963
3 changed files with 37 additions and 21 deletions

View File

@ -779,27 +779,33 @@ begin
Assert(resource_instance<>nil);
ri:=TvImage2(resource_instance^.resource^.rimage);
if (ri=nil) then
if not resource_instance^.prepared then
begin
ri:=FetchImage(ctx.Cmd,
FImage,
resource_instance^.curr.img_usage
);
resource_instance^.prepared:=true;
ri:=TvImage2(resource_instance^.resource^.rimage);
if (ri=nil) then
begin
ri:=FetchImage(ctx.Cmd,
FImage,
resource_instance^.curr.img_usage
);
resource_instance^.resource^.rimage:=ri;
end;
//Writeln(ri.key.cformat);
pm4_load_from(ctx.Cmd,ri,resource_instance^.curr.mem_usage);
ri.PushBarrier(ctx.Cmd,
GetAccessMask(resource_instance^.curr),
GetImageLayout(resource_instance^.curr),
ord(VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT));
resource_instance^.resource^.rimage:=ri;
end;
//Writeln(ri.key.cformat);
pm4_load_from(ctx.Cmd,ri,resource_instance^.curr.mem_usage);
ri.PushBarrier(ctx.Cmd,
GetAccessMask(resource_instance^.curr),
GetImageLayout(resource_instance^.curr),
ord(VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT));
end;
end;
@ -895,6 +901,8 @@ begin
begin
iv:=ri.FetchView(ctx.Cmd,FView,iu_sampled);
//Writeln('BindImage:','0x',HexStr(ri.FHandle,16),' 0x',HexStr(iv.FHandle,16));
DescriptorGroup.BindImage(fset,bind,
iv.FHandle,
GetImageLayout(resource_instance^.curr));
@ -903,6 +911,8 @@ begin
begin
iv:=ri.FetchView(ctx.Cmd,FView,iu_storage);
//Writeln('BindStorage:','0x',HexStr(ri.FHandle,16),' 0x',HexStr(iv.FHandle,16));
DescriptorGroup.BindStorage(fset,bind,
iv.FHandle,
GetImageLayout(resource_instance^.curr));

View File

@ -192,6 +192,8 @@ type
//
resource:p_pm4_resource;
//
prepared:Boolean;
//
curr:t_pm4_usage;
prev:t_pm4_usage;
next:t_pm4_usage;

View File

@ -819,7 +819,7 @@ var
vkLayer :array[0..0] of PChar;
vkCInfo :TVkInstanceCreateInfo;
vkPrintf :TVkValidationFeaturesEXT;
vkFeature:TVkValidationFeatureEnableEXT;
vkFeature:array[0..4] of TVkValidationFeatureEnableEXT;
Features2:TVkPhysicalDeviceFeatures2;
F16_8 :TVkPhysicalDeviceShaderFloat16Int8Features;
FSF_8 :TVkPhysicalDevice8BitStorageFeatures;
@ -865,12 +865,16 @@ begin
if debug and printf then
begin
vkFeature:=VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT;
vkFeature[0]:=VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT;
vkFeature[1]:=VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT;
//vkFeature[]:=VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT;
//vkFeature[1]:=VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT;
vkFeature[2]:=VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT;
vkPrintf:=Default(TVkValidationFeaturesEXT);
vkPrintf.sType:=VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT;
vkPrintf.enabledValidationFeatureCount:=1;
vkPrintf.pEnabledValidationFeatures :=@vkFeature;
vkPrintf.enabledValidationFeatureCount:=3;
vkPrintf.pEnabledValidationFeatures :=@vkFeature[0];
vkCInfo.pNext:=@vkPrintf;
end;