Fix Legacy Overlay & Fix Spammed Begin Error

This commit is contained in:
BenjaminZehowlt
2025-10-20 13:22:02 -04:00
committed by Natsumi
parent b1f85d4b80
commit 8c67b049d7
3 changed files with 66 additions and 53 deletions
-1
View File
@@ -110,7 +110,6 @@ namespace VRCX
if ((IntPtr)_renderTarget.Handle == IntPtr.Zero)
return;
_deviceContext.Begin(_query);
using ComPtr<ID3D11Texture2D> cefTexture =
_device1.OpenSharedResource1<ID3D11Texture2D>(paintInfo.SharedTextureHandle.ToPointer());
_deviceContext.CopyResource(_renderTarget, cefTexture);
+8 -2
View File
@@ -139,6 +139,8 @@ namespace VRCX
_device.SetInfoQueueCallback(msg => logger.Info(SilkMarshal.PtrToString((nint)msg.PDescription)!));
_texture1.Dispose();
SilkMarshal.ThrowHResult
(
_device.CreateTexture2D(new Texture2DDesc
{
Width = 512,
@@ -152,10 +154,13 @@ namespace VRCX
Quality = 0
},
BindFlags = (uint)BindFlag.ShaderResource
}, null, ref _texture1);
}, null, ref _texture1)
);
_wristOverlay?.UpdateRender(_device, _deviceContext, _texture1);
_texture2.Dispose();
SilkMarshal.ThrowHResult
(
_device.CreateTexture2D(new Texture2DDesc
{
Width = 1024,
@@ -169,7 +174,8 @@ namespace VRCX
Quality = 0
},
BindFlags = (uint)BindFlag.ShaderResource
}, null, ref _texture2);
}, null, ref _texture2)
);
_hmdOverlay?.UpdateRender(_device, _deviceContext, _texture2);
}
}
+12 -4
View File
@@ -133,6 +133,8 @@ namespace VRCX
_device.SetInfoQueueCallback(msg => logger.Info(SilkMarshal.PtrToString((nint)msg.PDescription)!));
_texture1.Dispose();
SilkMarshal.ThrowHResult
(
_device.CreateTexture2D(new Texture2DDesc
{
Width = 512,
@@ -145,10 +147,14 @@ namespace VRCX
Count = 1,
Quality = 0
},
BindFlags = (uint)BindFlag.ShaderResource
}, null, ref _texture1);
BindFlags = (uint)BindFlag.ShaderResource,
CPUAccessFlags = (uint)CpuAccessFlag.Write
}, null, ref _texture1)
);
_texture2.Dispose();
SilkMarshal.ThrowHResult
(
_device.CreateTexture2D(new Texture2DDesc
{
Width = 1024,
@@ -161,8 +167,10 @@ namespace VRCX
Count = 1,
Quality = 0
},
BindFlags = (uint)BindFlag.ShaderResource
}, null, ref _texture2);
BindFlags = (uint)BindFlag.ShaderResource,
CPUAccessFlags = (uint)CpuAccessFlag.Write
}, null, ref _texture2)
);
}
}