diff --git a/Dotnet/Overlay/Cef/OffScreenBrowser.cs b/Dotnet/Overlay/Cef/OffScreenBrowser.cs index 1d886111..2e45af18 100644 --- a/Dotnet/Overlay/Cef/OffScreenBrowser.cs +++ b/Dotnet/Overlay/Cef/OffScreenBrowser.cs @@ -110,7 +110,6 @@ namespace VRCX if ((IntPtr)_renderTarget.Handle == IntPtr.Zero) return; - _deviceContext.Begin(_query); using ComPtr cefTexture = _device1.OpenSharedResource1(paintInfo.SharedTextureHandle.ToPointer()); _deviceContext.CopyResource(_renderTarget, cefTexture); diff --git a/Dotnet/Overlay/Cef/VRCXVRCef.cs b/Dotnet/Overlay/Cef/VRCXVRCef.cs index fed90b47..2f1e561d 100644 --- a/Dotnet/Overlay/Cef/VRCXVRCef.cs +++ b/Dotnet/Overlay/Cef/VRCXVRCef.cs @@ -139,37 +139,43 @@ namespace VRCX _device.SetInfoQueueCallback(msg => logger.Info(SilkMarshal.PtrToString((nint)msg.PDescription)!)); _texture1.Dispose(); - _device.CreateTexture2D(new Texture2DDesc - { - Width = 512, - Height = 512, - MipLevels = 1, - ArraySize = 1, - Format = Format.FormatB8G8R8A8Unorm, - SampleDesc = new SampleDesc + SilkMarshal.ThrowHResult + ( + _device.CreateTexture2D(new Texture2DDesc { - Count = 1, - Quality = 0 - }, - BindFlags = (uint)BindFlag.ShaderResource - }, null, ref _texture1); + Width = 512, + Height = 512, + MipLevels = 1, + ArraySize = 1, + Format = Format.FormatB8G8R8A8Unorm, + SampleDesc = new SampleDesc + { + Count = 1, + Quality = 0 + }, + BindFlags = (uint)BindFlag.ShaderResource + }, null, ref _texture1) + ); _wristOverlay?.UpdateRender(_device, _deviceContext, _texture1); _texture2.Dispose(); - _device.CreateTexture2D(new Texture2DDesc - { - Width = 1024, - Height = 1024, - MipLevels = 1, - ArraySize = 1, - Format = Format.FormatB8G8R8A8Unorm, - SampleDesc = new SampleDesc + SilkMarshal.ThrowHResult + ( + _device.CreateTexture2D(new Texture2DDesc { - Count = 1, - Quality = 0 - }, - BindFlags = (uint)BindFlag.ShaderResource - }, null, ref _texture2); + Width = 1024, + Height = 1024, + MipLevels = 1, + ArraySize = 1, + Format = Format.FormatB8G8R8A8Unorm, + SampleDesc = new SampleDesc + { + Count = 1, + Quality = 0 + }, + BindFlags = (uint)BindFlag.ShaderResource + }, null, ref _texture2) + ); _hmdOverlay?.UpdateRender(_device, _deviceContext, _texture2); } } diff --git a/Dotnet/Overlay/Cef/VRCXVRLegacy.cs b/Dotnet/Overlay/Cef/VRCXVRLegacy.cs index cdbdbb56..163f41de 100644 --- a/Dotnet/Overlay/Cef/VRCXVRLegacy.cs +++ b/Dotnet/Overlay/Cef/VRCXVRLegacy.cs @@ -133,36 +133,44 @@ namespace VRCX _device.SetInfoQueueCallback(msg => logger.Info(SilkMarshal.PtrToString((nint)msg.PDescription)!)); _texture1.Dispose(); - _device.CreateTexture2D(new Texture2DDesc - { - Width = 512, - Height = 512, - MipLevels = 1, - ArraySize = 1, - Format = Format.FormatB8G8R8A8Unorm, - SampleDesc = new SampleDesc + SilkMarshal.ThrowHResult + ( + _device.CreateTexture2D(new Texture2DDesc { - Count = 1, - Quality = 0 - }, - BindFlags = (uint)BindFlag.ShaderResource - }, null, ref _texture1); + Width = 512, + Height = 512, + MipLevels = 1, + ArraySize = 1, + Format = Format.FormatB8G8R8A8Unorm, + SampleDesc = new SampleDesc + { + Count = 1, + Quality = 0 + }, + BindFlags = (uint)BindFlag.ShaderResource, + CPUAccessFlags = (uint)CpuAccessFlag.Write + }, null, ref _texture1) + ); _texture2.Dispose(); - _device.CreateTexture2D(new Texture2DDesc - { - Width = 1024, - Height = 1024, - MipLevels = 1, - ArraySize = 1, - Format = Format.FormatB8G8R8A8Unorm, - SampleDesc = new SampleDesc + SilkMarshal.ThrowHResult + ( + _device.CreateTexture2D(new Texture2DDesc { - Count = 1, - Quality = 0 - }, - BindFlags = (uint)BindFlag.ShaderResource - }, null, ref _texture2); + Width = 1024, + Height = 1024, + MipLevels = 1, + ArraySize = 1, + Format = Format.FormatB8G8R8A8Unorm, + SampleDesc = new SampleDesc + { + Count = 1, + Quality = 0 + }, + BindFlags = (uint)BindFlag.ShaderResource, + CPUAccessFlags = (uint)CpuAccessFlag.Write + }, null, ref _texture2) + ); } }