mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
abf83b729e
commit
cad2d30172
|
@ -69,6 +69,10 @@ const
|
||||||
|
|
||||||
procedure vSubmitDone;
|
procedure vSubmitDone;
|
||||||
|
|
||||||
|
var
|
||||||
|
DEPTH_DISABLE_HACK:Boolean=false;
|
||||||
|
COMPUTE_DISABLE_HACK:Boolean=false;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
|
@ -1893,8 +1897,8 @@ begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not GPU_REGS.COMP_ENABLE then Exit(false);
|
if DEPTH_DISABLE_HACK and (not GPU_REGS.COMP_ENABLE) then Exit(false);
|
||||||
if GPU_REGS.DB_ENABLE {false} then
|
if (not DEPTH_DISABLE_HACK) and GPU_REGS.DB_ENABLE {false} then
|
||||||
begin
|
begin
|
||||||
DB_INFO:=GPU_REGS.GET_DB_INFO;
|
DB_INFO:=GPU_REGS.GET_DB_INFO;
|
||||||
|
|
||||||
|
@ -2200,7 +2204,7 @@ begin
|
||||||
//writeln;
|
//writeln;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure UpdateGpuRegsInfoCompute;
|
function UpdateGpuRegsInfoCompute:Boolean;
|
||||||
var
|
var
|
||||||
FUniformBuilder:TvUniformBuilder;
|
FUniformBuilder:TvUniformBuilder;
|
||||||
|
|
||||||
|
@ -2221,13 +2225,16 @@ var
|
||||||
|
|
||||||
FComputePipeline:TvComputePipeline2;
|
FComputePipeline:TvComputePipeline2;
|
||||||
begin
|
begin
|
||||||
|
Result:=False;
|
||||||
|
|
||||||
|
if COMPUTE_DISABLE_HACK then Exit;
|
||||||
|
|
||||||
{$ifdef null_rt}Exit;{$endif}
|
{$ifdef null_rt}Exit;{$endif}
|
||||||
|
|
||||||
if (LastSetShCount=GFXRing.SetShCount) and
|
if (LastSetShCount=GFXRing.SetShCount) and
|
||||||
(LastSetCxCount=GFXRing.SetCxCount) then
|
(LastSetCxCount=GFXRing.SetCxCount) then
|
||||||
begin
|
begin
|
||||||
Exit;
|
Exit(True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LastSetShCount:=GFXRing.SetShCount;
|
LastSetShCount:=GFXRing.SetShCount;
|
||||||
|
@ -2300,6 +2307,7 @@ begin
|
||||||
GFXRing.CmdBuffer.BindSets(VK_PIPELINE_BIND_POINT_COMPUTE,FDescriptorGroup);
|
GFXRing.CmdBuffer.BindSets(VK_PIPELINE_BIND_POINT_COMPUTE,FDescriptorGroup);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Result:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure test_reset_index(INDEX_TYPE:TVkIndexType;RESET_EN:Byte;IB_RESET_INDX:DWORD);
|
procedure test_reset_index(INDEX_TYPE:TVkIndexType;RESET_EN:Byte;IB_RESET_INDX:DWORD);
|
||||||
|
@ -2409,9 +2417,10 @@ end;
|
||||||
procedure onDispatchDirect(pm4Hdr:PM4_TYPE_3_HEADER;Body:PPM4CMDDISPATCHDIRECT);
|
procedure onDispatchDirect(pm4Hdr:PM4_TYPE_3_HEADER;Body:PPM4CMDDISPATCHDIRECT);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
UpdateGpuRegsInfoCompute;
|
if UpdateGpuRegsInfoCompute then
|
||||||
|
begin
|
||||||
GFXRing.CmdBuffer.DispatchDirect(Body^.dimX,Body^.dimY,Body^.dimZ);
|
GFXRing.CmdBuffer.DispatchDirect(Body^.dimX,Body^.dimY,Body^.dimZ);
|
||||||
|
end;
|
||||||
|
|
||||||
{$ifdef ww}Writeln('onDispatchDirect:',Body^.dimX,':',Body^.dimY,':',Body^.dimZ);{$endif}
|
{$ifdef ww}Writeln('onDispatchDirect:',Body^.dimX,':',Body^.dimY,':',Body^.dimZ);{$endif}
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,8 @@ begin
|
||||||
if (mode and SCE_SAVE_DATA_MOUNT_MODE_CREATE)<>0 then
|
if (mode and SCE_SAVE_DATA_MOUNT_MODE_CREATE)<>0 then
|
||||||
begin
|
begin
|
||||||
if not ForceDirectories(ps4_app.save_path) then Exit(SCE_SAVE_DATA_ERROR_INTERNAL);
|
if not ForceDirectories(ps4_app.save_path) then Exit(SCE_SAVE_DATA_ERROR_INTERNAL);
|
||||||
if not CreateDir(sp) then Exit(SCE_SAVE_DATA_ERROR_EXISTS);
|
//if not CreateDir(sp) then Exit(SCE_SAVE_DATA_ERROR_EXISTS);
|
||||||
|
CreateDir(sp);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
if not DirectoryExists(sp) then Exit(SCE_SAVE_DATA_ERROR_NOT_FOUND);
|
if not DirectoryExists(sp) then Exit(SCE_SAVE_DATA_ERROR_NOT_FOUND);
|
||||||
|
|
|
@ -342,14 +342,133 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
SCE_SAVE_DATA_SORT_KEY_DIRNAME =0;
|
||||||
|
SCE_SAVE_DATA_SORT_KEY_USER_PARAM =1;
|
||||||
|
SCE_SAVE_DATA_SORT_KEY_BLOCKS =2;
|
||||||
|
SCE_SAVE_DATA_SORT_KEY_MTIME =3;
|
||||||
|
SCE_SAVE_DATA_SORT_KEY_FREE_BLOCKS=4;
|
||||||
|
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_ASCENT =0;
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_DESCENT=1;
|
||||||
|
|
||||||
|
function _convert_dir_name_search(P:PChar):RawByteString;
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
Result:=RawByteString(P); //copy
|
||||||
|
if (Length(Result)=0) then
|
||||||
|
begin
|
||||||
|
Result:='*';
|
||||||
|
end else
|
||||||
|
For i:=1 to Length(Result) do
|
||||||
|
begin
|
||||||
|
Case Result[i] of
|
||||||
|
'%':Result[i]:='*';
|
||||||
|
'_':Result[i]:='#';
|
||||||
|
else;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function StringListAscCompare(List:TStringList;Index1,Index2:Integer):Integer;
|
||||||
|
begin
|
||||||
|
Result:=CompareStr(List[Index1],List[Index2]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function StringListDscCompare(List:TStringList;Index1,Index2:Integer):Integer;
|
||||||
|
begin
|
||||||
|
Result:=CompareStr(List[Index2],List[Index1]);
|
||||||
|
end;
|
||||||
|
|
||||||
function ps4_sceSaveDataDirNameSearch(cond:pSceSaveDataDirNameSearchCond;
|
function ps4_sceSaveDataDirNameSearch(cond:pSceSaveDataDirNameSearchCond;
|
||||||
sres:pSceSaveDataDirNameSearchResult):Integer; SysV_ABI_CDecl;
|
sres:pSceSaveDataDirNameSearchResult):Integer; SysV_ABI_CDecl;
|
||||||
|
var
|
||||||
|
ROut:TRawByteSearchRec;
|
||||||
|
S,F:RawByteString;
|
||||||
|
List:TStringList;
|
||||||
|
i,n:Integer;
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
if (sres<>nil) then
|
|
||||||
begin
|
if (cond=nil) then Exit(SCE_SAVE_DATA_ERROR_PARAMETER);
|
||||||
sres^:=Default(SceSaveDataDirNameSearchResult);
|
if (sres=nil) then Exit(SCE_SAVE_DATA_ERROR_PARAMETER);
|
||||||
|
|
||||||
|
Case cond^.order of
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_ASCENT :;
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_DESCENT:;
|
||||||
|
else
|
||||||
|
Exit(SCE_SAVE_DATA_ERROR_PARAMETER);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Assert(cond^.key =SCE_SAVE_DATA_SORT_KEY_DIRNAME);
|
||||||
|
|
||||||
|
s:=IncludeTrailingPathDelimiter(ps4_app.save_path)+_convert_dir_name_search(@cond^.dirName);
|
||||||
|
|
||||||
|
ROut:=Default(TRawByteSearchRec);
|
||||||
|
if (FindFirst(s,faDirectory,ROut)=0) then
|
||||||
|
begin
|
||||||
|
List:=TStringList.Create;
|
||||||
|
repeat
|
||||||
|
if (ROut.FindData.dwFileAttributes and faDirectory)=faDirectory then
|
||||||
|
begin
|
||||||
|
F:=UTF8Encode(WideString(ROut.FindData.cFileName));
|
||||||
|
Case F of
|
||||||
|
'.','..':;
|
||||||
|
else
|
||||||
|
List.Add(F);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
until (FindNext(ROut)<>0);
|
||||||
|
FindClose(ROut);
|
||||||
|
|
||||||
|
sres^.hitNum:=List.Count;
|
||||||
|
if (List.Count<>0) and (sres^.dirNamesNum<>0) then
|
||||||
|
begin
|
||||||
|
Case cond^.order of
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_ASCENT :List.CustomSort(@StringListAscCompare);
|
||||||
|
SCE_SAVE_DATA_SORT_ORDER_DESCENT:List.CustomSort(@StringListDscCompare);
|
||||||
|
else;
|
||||||
|
end;
|
||||||
|
|
||||||
|
n:=List.Count;
|
||||||
|
if (n>sres^.dirNamesNum) then n:=sres^.dirNamesNum;
|
||||||
|
|
||||||
|
sres^.setNum:=n;
|
||||||
|
|
||||||
|
For i:=0 to n-1 do
|
||||||
|
begin
|
||||||
|
s:=List[i];
|
||||||
|
|
||||||
|
if (sres^.dirNames<>nil) then
|
||||||
|
begin
|
||||||
|
sres^.dirNames[i]:=Default(SceSaveDataDirName);
|
||||||
|
MoveChar0(PChar(s)^,sres^.dirNames[i],SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE);
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (sres^.params<>nil) then
|
||||||
|
begin
|
||||||
|
sres^.params[i]:=Default(SceSaveDataParam);
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (sres^.infos<>nil) then
|
||||||
|
begin
|
||||||
|
sres^.infos[i]:=Default(SceSaveDataSearchInfo);
|
||||||
|
sres^.infos[i].blocks :=100000;
|
||||||
|
sres^.infos[i].freeBlocks:=100000;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
sres^.setNum:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
FreeAndNil(List);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -103,6 +103,10 @@ const
|
||||||
handleTypes:ord(VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT);
|
handleTypes:ord(VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT);
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var
|
||||||
|
IMAGE_TEST_HACK:Boolean=False;
|
||||||
|
IMAGE_LOAD_HACK:Boolean=False;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -639,18 +643,28 @@ begin
|
||||||
if ((Result.data_usage and TM_READ)<>0) and (Result.submit_id<>cmd.submit_id) then
|
if ((Result.data_usage and TM_READ)<>0) and (Result.submit_id<>cmd.submit_id) then
|
||||||
begin
|
begin
|
||||||
//hash test
|
//hash test
|
||||||
|
|
||||||
|
if IMAGE_TEST_HACK then
|
||||||
|
begin
|
||||||
|
Result.data_usage:=Result.data_usage and (not TM_READ);
|
||||||
|
end else
|
||||||
if CheckFromBuffer(Result) then
|
if CheckFromBuffer(Result) then
|
||||||
begin
|
begin
|
||||||
Result.data_usage:=Result.data_usage and (not TM_READ);
|
Result.data_usage:=Result.data_usage and (not TM_READ);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ((Result.data_usage and TM_READ)=0) and ((data_usage and TM_READ)<>0) then
|
if ((Result.data_usage and TM_READ)=0) and ((data_usage and TM_READ)<>0) then
|
||||||
begin
|
begin
|
||||||
Result.submit_id:=cmd.submit_id;
|
Result.submit_id:=cmd.submit_id;
|
||||||
Result.data_usage:=Result.data_usage or TM_READ;
|
Result.data_usage:=Result.data_usage or TM_READ;
|
||||||
|
|
||||||
|
if not IMAGE_LOAD_HACK then
|
||||||
|
begin
|
||||||
LoadFromBuffer(cmd,Result);
|
LoadFromBuffer(cmd,Result);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,9 @@ Function TryGetHostPointerByAddr(addr:Pointer;var P:TvPointer;SizeOut:PQWORD=nil
|
||||||
function GetHostMappedRequirements:TVkMemoryRequirements;
|
function GetHostMappedRequirements:TVkMemoryRequirements;
|
||||||
function GetSparceMemoryTypes:TVkUInt32;
|
function GetSparceMemoryTypes:TVkUInt32;
|
||||||
|
|
||||||
|
var
|
||||||
|
MEMORY_BOUND_HACK:Boolean=False;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
@ -673,7 +676,10 @@ begin
|
||||||
InitVulkan;
|
InitVulkan;
|
||||||
|
|
||||||
//Some games request too much video memory, relevant for built-in iGPU
|
//Some games request too much video memory, relevant for built-in iGPU
|
||||||
|
if MEMORY_BOUND_HACK then
|
||||||
|
begin
|
||||||
if (len>1024*1024*1024) then len:=1024*1024*1024;
|
if (len>1024*1024*1024) then len:=1024*1024*1024;
|
||||||
|
end;
|
||||||
|
|
||||||
Result:=vkAllocHostPointer(Device.FHandle,len,MemManager.FHostVisibMt{FHostCacheMt},addr);
|
Result:=vkAllocHostPointer(Device.FHandle,len,MemManager.FHostVisibMt{FHostCacheMt},addr);
|
||||||
Assert(Result<>VK_NULL_HANDLE);
|
Assert(Result<>VK_NULL_HANDLE);
|
||||||
|
|
Loading…
Reference in New Issue