mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
30b554f328
commit
39f9084817
|
@ -80,8 +80,8 @@ type
|
|||
isPooledMemory :0..1;
|
||||
isCommitted :0..1;
|
||||
end;
|
||||
align:array[0..6] of Byte;
|
||||
name:array[0..SCE_KERNEL_VIRTUAL_RANGE_NAME_SIZE-1] of AnsiChar;
|
||||
align:array[0..6] of Byte;
|
||||
end;
|
||||
|
||||
function ps4_sceKernelGetDirectMemorySize:Int64; SysV_ABI_CDecl;
|
||||
|
|
|
@ -225,6 +225,7 @@ function uniformBuffer8Bit:Boolean;
|
|||
function storageBuffer16Bit:Boolean;
|
||||
function uniformBuffer16Bit:Boolean;
|
||||
function storageInputOutput16:Boolean;
|
||||
function sparseBinding:Boolean;
|
||||
|
||||
var
|
||||
limits:record
|
||||
|
@ -334,6 +335,11 @@ begin
|
|||
Result:=Boolean(VulkanApp.FSF16.storageInputOutput16);
|
||||
end;
|
||||
|
||||
function sparseBinding:Boolean;
|
||||
begin
|
||||
Result:=Boolean(VulkanApp.FDeviceFeature.sparseBinding);
|
||||
end;
|
||||
|
||||
procedure FillDeviceProperties(physicalDevice:TVkPhysicalDevice);
|
||||
var
|
||||
prop:TVkPhysicalDeviceProperties2;
|
||||
|
|
|
@ -10,6 +10,7 @@ uses
|
|||
sys_types,
|
||||
g23tree,
|
||||
Vulkan,
|
||||
vDevice,
|
||||
vMemory,
|
||||
vBuffer,
|
||||
vCmdBuffer;
|
||||
|
@ -123,6 +124,8 @@ var
|
|||
t:TvHostBuffer;
|
||||
host:TvPointer;
|
||||
|
||||
_size:qword;
|
||||
|
||||
label
|
||||
_exit;
|
||||
|
||||
|
@ -149,10 +152,11 @@ begin
|
|||
begin
|
||||
//Writeln('NewBuf:',HexStr(Addr));
|
||||
host:=Default(TvPointer);
|
||||
if not TryGetHostPointerByAddr(addr,host) then
|
||||
if not TryGetHostPointerByAddr(addr,host,@_size) then
|
||||
begin
|
||||
Goto _exit;
|
||||
end;
|
||||
Assert(_size>=Size,'Sparse buffers TODO:'+BooltoStr(vDevice.sparseBinding,True));
|
||||
t:=_New(host,Size,usage);
|
||||
t.FAddr:=addr;
|
||||
FHostBufferSet.Insert(@t.FAddr);
|
||||
|
|
|
@ -84,7 +84,7 @@ function vkAllocHostPointer(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt3
|
|||
function vkAllocDedicatedImage(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkImage):TVkDeviceMemory;
|
||||
function vkAllocDedicatedBuffer(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkBuffer):TVkDeviceMemory;
|
||||
|
||||
Function TryGetHostPointerByAddr(addr:Pointer;var P:TvPointer):Boolean;
|
||||
Function TryGetHostPointerByAddr(addr:Pointer;var P:TvPointer;SizeOut:PQWORD=nil):Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -637,7 +637,7 @@ begin
|
|||
vkFreeMemory(Device.FHandle,h,nil);
|
||||
end;
|
||||
|
||||
Function TryGetHostPointerByAddr(addr:Pointer;var P:TvPointer):Boolean;
|
||||
Function TryGetHostPointerByAddr(addr:Pointer;var P:TvPointer;SizeOut:PQWORD=nil):Boolean;
|
||||
var
|
||||
block:TGpuMemBlock;
|
||||
begin
|
||||
|
@ -646,6 +646,12 @@ begin
|
|||
begin
|
||||
P.FHandle:=TVkDeviceMemory(block.Handle);
|
||||
P.FOffset:=addr-block.pAddr;
|
||||
|
||||
if (SizeOut<>nil) then
|
||||
begin
|
||||
SizeOut^:=block.nSize-P.FOffset;
|
||||
end;
|
||||
|
||||
Result:=True;
|
||||
end;
|
||||
end;
|
||||
|
|
Loading…
Reference in New Issue