This commit is contained in:
pypy
2020-11-08 16:35:14 +09:00
parent e54315c28c
commit 2160995736
2 changed files with 21 additions and 21 deletions
+1 -4
View File
@@ -74,9 +74,7 @@ namespace VRCX
{ {
if (type == PaintElementType.View) if (type == PaintElementType.View)
{ {
using (var device = _texture.Device) var context = _texture.Device.ImmediateContext;
using (var context = device.ImmediateContext)
{
var dataBox = context.MapSubresource(_texture, 0, MapMode.WriteDiscard, MapFlags.None); var dataBox = context.MapSubresource(_texture, 0, MapMode.WriteDiscard, MapFlags.None);
if (dataBox.IsEmpty == false) if (dataBox.IsEmpty == false)
{ {
@@ -101,7 +99,6 @@ namespace VRCX
context.UnmapSubresource(_texture, 0); context.UnmapSubresource(_texture, 0);
} }
} }
}
void IRenderHandler.OnPopupShow(bool show) void IRenderHandler.OnPopupShow(bool show)
{ {
+4 -1
View File
@@ -41,7 +41,10 @@ namespace VRCX
// 메모리 릭 때문에 미리 생성해놓고 계속 사용함 // 메모리 릭 때문에 미리 생성해놓고 계속 사용함
public static void Init() public static void Init()
{ {
m_Device = new Device(DriverType.Hardware, DeviceCreationFlags.SingleThreaded | DeviceCreationFlags.BgraSupport); m_Device = new Device(
DriverType.Hardware,
DeviceCreationFlags.BgraSupport
);
m_Texture1 = new Texture2D(m_Device, new Texture2DDescription() m_Texture1 = new Texture2D(m_Device, new Texture2DDescription()
{ {
Width = 512, Width = 512,