public static void SetDebugObjectName(this ID3D11DeviceChild child, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException(null, nameof(name));
            }

            using (var mem = new ComMemory(name))
            {
                child.SetPrivateData(WKPDID_D3DDebugObjectNameW, (uint)(name.Length * 2), mem.Pointer).ThrowOnError();
            }
        }
Example #2
0
        public static void SetDebugObjectName(this ID3D11DeviceChild child, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException(null, nameof(name));
            }

            using (var mem = new ComMemory(name))
            {
#pragma warning disable CA1062 // Validate arguments of public methods
                _ = child.SetPrivateData(WKPDID_D3DDebugObjectNameW, (uint)(name.Length * 2), mem.Pointer).ThrowOnError();
#pragma warning restore CA1062 // Validate arguments of public methods
            }
        }