diff --git a/chip/ps4_gpu_regs.pas b/chip/ps4_gpu_regs.pas index 8648b22f..25121e8a 100644 --- a/chip/ps4_gpu_regs.pas +++ b/chip/ps4_gpu_regs.pas @@ -658,14 +658,21 @@ begin Result.srcColorBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].COLOR_SRCBLEND); Result.dstColorBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].COLOR_DESTBLEND); - Result.srcAlphaBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].ALPHA_SRCBLEND); - Result.dstAlphaBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].ALPHA_DESTBLEND); + Result.colorBlendOp :=GetBlendOp(CB_BLEND_CONTROL[i].COLOR_COMB_FCN); - Result.colorBlendOp:=GetBlendOp(CB_BLEND_CONTROL[i].COLOR_COMB_FCN); - Result.alphaBlendOp:=GetBlendOp(CB_BLEND_CONTROL[i].ALPHA_COMB_FCN); + if (CB_BLEND_CONTROL[i].SEPARATE_ALPHA_BLEND=0) then + begin + Result.srcAlphaBlendFactor:=Result.srcColorBlendFactor; + Result.dstAlphaBlendFactor:=Result.dstColorBlendFactor; + Result.alphaBlendOp :=Result.colorBlendOp; + end else //VkPhysicalDeviceFeatures.independentBlend + begin + Result.srcAlphaBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].ALPHA_SRCBLEND); + Result.dstAlphaBlendFactor:=GetBlendFactor(CB_BLEND_CONTROL[i].ALPHA_DESTBLEND); + Result.alphaBlendOp :=GetBlendOp(CB_BLEND_CONTROL[i].ALPHA_COMB_FCN); + end; - //(CB_BLEND_CONTROL[i].SEPARATE_ALPHA_BLEND=0); //VkPhysicalDeviceFeatures.independentBlend - Assert(CB_BLEND_CONTROL[i].DISABLE_ROP3 =0); + Assert(CB_BLEND_CONTROL[i].DISABLE_ROP3=0); end; //CB_COLOR_CONTROL.MODE //CB_DISABLE diff --git a/vulkan/vMemory.pas b/vulkan/vMemory.pas index 7d66c0fc..59f1d105 100644 --- a/vulkan/vMemory.pas +++ b/vulkan/vMemory.pas @@ -659,6 +659,10 @@ end; function OnGpuMemAlloc(addr:Pointer;len:size_t):TVkDeviceMemory; begin InitVulkan; + + //Some games request too much video memory, relevant for built-in iGPU + if (len>1024*1024*1024) then len:=1024*1024*1024; + Result:=vkAllocHostPointer(Device.FHandle,len,MemManager.FHostVisibMt{FHostCacheMt},addr); Assert(Result<>VK_NULL_HANDLE); end;