Beispiel #1
0
        private void SetDebugMarkerName(VkDebugReportObjectTypeEXT type, ulong target, string name)
        {
            Debug.Assert(_setObjectNameDelegate != null);

            VkDebugMarkerObjectNameInfoEXT nameInfo = VkDebugMarkerObjectNameInfoEXT.New();

            nameInfo.objectType = type;
            nameInfo.@object    = target;

            int   byteCount = Encoding.UTF8.GetByteCount(name);
            byte *utf8Ptr   = stackalloc byte[byteCount];

            fixed(char *namePtr = name)
            {
                Encoding.UTF8.GetBytes(namePtr, name.Length, utf8Ptr, byteCount);
                nameInfo.pObjectName = utf8Ptr;
                VkResult result = _setObjectNameDelegate(_device, &nameInfo);

                CheckResult(result);
            }
        }