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