Skip to content

Commit

Permalink
Release 1.35 - October 3rd - New Ozz Animation Unit Test | Updated Sh…
Browse files Browse the repository at this point in the history
…ader Translator | Maintenance update macOS / iOS

Release 1.35 - October 3rd - New Ozz Animation Unit Test | Updated Shader Translator | Maintenance update macOS / iOS
  • Loading branch information
wolfgangfengel authored Oct 3, 2019
2 parents 23a6a3c + 71e2e31 commit ad6deea
Show file tree
Hide file tree
Showing 184 changed files with 10,035 additions and 2,739 deletions.
4 changes: 2 additions & 2 deletions Common_3/OS/iOS/iOSBase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ unsigned getSystemTime()
time_t s; // Seconds
struct timespec spec;

clock_gettime(CLOCK_REALTIME, &spec);
clock_gettime(_CLOCK_MONOTONIC, &spec);

s = spec.tv_sec;
ms = round(spec.tv_nsec / 1.0e6); // Convert nanoseconds to milliseconds
Expand All @@ -95,7 +95,7 @@ unsigned getSystemTime()
int64_t getUSec()
{
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
clock_gettime(_CLOCK_MONOTONIC, &ts);
long us = (ts.tv_nsec / 1000);
us += ts.tv_sec * 1e6;
return us;
Expand Down
4 changes: 2 additions & 2 deletions Common_3/OS/macOS/macOSBase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ unsigned getSystemTime()
time_t s; // Seconds
struct timespec spec;

clock_gettime(CLOCK_REALTIME, &spec);
clock_gettime(_CLOCK_MONOTONIC, &spec);

s = spec.tv_sec;
ms = round(spec.tv_nsec / 1.0e6); // Convert nanoseconds to milliseconds
Expand All @@ -262,7 +262,7 @@ unsigned getSystemTime()
int64_t getUSec()
{
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
clock_gettime(_CLOCK_MONOTONIC, &ts);
long us = (ts.tv_nsec / 1000);
us += ts.tv_sec * 1e6;
return us;
Expand Down
4 changes: 2 additions & 2 deletions Common_3/Renderer/Direct3D11/Direct3D11CapBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
inline void utils_caps_builder(Renderer* pRenderer) {
memset(pRenderer->capBits.canShaderReadFrom, 0, sizeof(pRenderer->capBits.canShaderReadFrom));
memset(pRenderer->capBits.canShaderWriteTo, 0, sizeof(pRenderer->capBits.canShaderWriteTo));
memset(pRenderer->capBits.canColorWriteTo, 0, sizeof(pRenderer->capBits.canColorWriteTo));
memset(pRenderer->capBits.canRenderTargetWriteTo, 0, sizeof(pRenderer->capBits.canRenderTargetWriteTo));

for (uint32_t i = 0; i < TinyImageFormat_Count;++i) {
DXGI_FORMAT fmt = (DXGI_FORMAT) TinyImageFormat_ToDXGI_FORMAT((TinyImageFormat)i);
Expand All @@ -17,7 +17,7 @@ inline void utils_caps_builder(Renderer* pRenderer) {
pRenderer->pDxDevice->CheckFormatSupport(fmt, &formatSupport);
pRenderer->capBits.canShaderReadFrom[i] = (formatSupport & D3D11_FORMAT_SUPPORT_SHADER_SAMPLE) != 0;
pRenderer->capBits.canShaderWriteTo[i] = (formatSupport & D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW) != 0;
pRenderer->capBits.canColorWriteTo[i] = (formatSupport & D3D11_FORMAT_SUPPORT_RENDER_TARGET) != 0;
pRenderer->capBits.canRenderTargetWriteTo[i] = (formatSupport & D3D11_FORMAT_SUPPORT_RENDER_TARGET) != 0;
}

}
4 changes: 2 additions & 2 deletions Common_3/Renderer/Direct3D12/Direct3D12CapBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
inline void utils_caps_builder(Renderer* pRenderer) {
memset(pRenderer->capBits.canShaderReadFrom, 0, sizeof(pRenderer->capBits.canShaderReadFrom));
memset(pRenderer->capBits.canShaderWriteTo, 0, sizeof(pRenderer->capBits.canShaderWriteTo));
memset(pRenderer->capBits.canColorWriteTo, 0, sizeof(pRenderer->capBits.canColorWriteTo));
memset(pRenderer->capBits.canRenderTargetWriteTo, 0, sizeof(pRenderer->capBits.canRenderTargetWriteTo));

for (uint32_t i = 0; i < TinyImageFormat_Count;++i) {
DXGI_FORMAT fmt = (DXGI_FORMAT) TinyImageFormat_ToDXGI_FORMAT((TinyImageFormat)i);
Expand All @@ -17,7 +17,7 @@ inline void utils_caps_builder(Renderer* pRenderer) {
pRenderer->pDxDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &formatSupport, sizeof(formatSupport));
pRenderer->capBits.canShaderReadFrom[i] = (formatSupport.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE) != 0;
pRenderer->capBits.canShaderWriteTo[i] = (formatSupport.Support2 & D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE) != 0;
pRenderer->capBits.canColorWriteTo[i] = (formatSupport.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) != 0;
pRenderer->capBits.canRenderTargetWriteTo[i] = (formatSupport.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) != 0;
}

}
6 changes: 1 addition & 5 deletions Common_3/Renderer/IRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -906,10 +906,6 @@ typedef struct RenderTarget
#if defined(VULKAN)
VkImageView* pVkDescriptors;
#endif
#if defined(TARGET_IOS)
// A separate texture is needed for stencil rendering on iOS.
Texture* pStencil;
#endif
#if defined(DIRECT3D11)
union
{
Expand Down Expand Up @@ -1765,7 +1761,7 @@ typedef struct GPUVendorPreset
typedef struct GPUCapBits {
bool canShaderReadFrom[TinyImageFormat_Count];
bool canShaderWriteTo[TinyImageFormat_Count];
bool canColorWriteTo[TinyImageFormat_Count];
bool canRenderTargetWriteTo[TinyImageFormat_Count];
} GPUCapBits;

typedef enum DefaultResourceAlignment
Expand Down
187 changes: 106 additions & 81 deletions Common_3/Renderer/Metal/MetalCapBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inline void utils_caps_builder(Renderer* pRenderer) {

memset(pRenderer->capBits.canShaderReadFrom, 0, sizeof(pRenderer->capBits.canShaderReadFrom));
memset(pRenderer->capBits.canShaderWriteTo, 0, sizeof(pRenderer->capBits.canShaderWriteTo));
memset(pRenderer->capBits.canColorWriteTo, 0, sizeof(pRenderer->capBits.canColorWriteTo));
memset(pRenderer->capBits.canRenderTargetWriteTo, 0, sizeof(pRenderer->capBits.canRenderTargetWriteTo));

// all pixel formats that metal support it claims can be sampled from if they exist on the platform
// this is however a lie when compressed texture formats
Expand All @@ -26,7 +26,7 @@ inline void utils_caps_builder(Renderer* pRenderer) {
}
}
#define CAN_SHADER_WRITE(x) pRenderer->capBits.canShaderWriteTo[TinyImageFormat_##x] = true;
#define CAN_COLOR_WRITE(x) pRenderer->capBits.canColorWriteTo[TinyImageFormat_##x] = true;
#define CAN_RENDER_TARGET_WRITE(x) pRenderer->capBits.canRenderTargetWriteTo[TinyImageFormat_##x] = true;

// this call is supported on mac and ios
// technially I think you can write but not read some texture, this is telling
Expand Down Expand Up @@ -66,42 +66,57 @@ inline void utils_caps_builder(Renderer* pRenderer) {
familyTier = [pRenderer->pDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v4] ? 1 : familyTier;

if( familyTier >= 1 ) {
CAN_COLOR_WRITE(R8_UNORM); // this has a subscript 8 which makes no sense
CAN_COLOR_WRITE(R8_SNORM);
CAN_COLOR_WRITE(R8_UINT);
CAN_COLOR_WRITE(R8_SINT);

CAN_COLOR_WRITE(R16_UNORM);
CAN_COLOR_WRITE(R16_SNORM);
CAN_COLOR_WRITE(R16_SFLOAT);
CAN_COLOR_WRITE(R16_UINT);
CAN_COLOR_WRITE(R16_SINT);

CAN_COLOR_WRITE(R8G8_UNORM);
CAN_COLOR_WRITE(R8G8_SNORM);
CAN_COLOR_WRITE(R8G8_UINT);
CAN_COLOR_WRITE(R8G8_SINT);

CAN_COLOR_WRITE(R8G8B8A8_UNORM);
CAN_COLOR_WRITE(R8G8B8A8_SNORM);
CAN_COLOR_WRITE(R8G8B8A8_SRGB);
CAN_COLOR_WRITE(B8G8R8A8_UNORM);
CAN_COLOR_WRITE(B8G8R8A8_SRGB);
CAN_COLOR_WRITE(R16G16_UNORM);
CAN_COLOR_WRITE(R16G16_SNORM);
CAN_COLOR_WRITE(R16G16_SFLOAT);
CAN_COLOR_WRITE(R32_SFLOAT);
CAN_COLOR_WRITE(A2R10G10B10_UNORM);
CAN_COLOR_WRITE(A2B10G10R10_UNORM);
CAN_COLOR_WRITE(B10G11R11_UFLOAT);

CAN_COLOR_WRITE(R16G16B16A16_UNORM);
CAN_COLOR_WRITE(R16G16B16A16_SNORM);
CAN_COLOR_WRITE(R16G16B16A16_SFLOAT);
CAN_COLOR_WRITE(R32G32_SFLOAT);

CAN_COLOR_WRITE(R32G32B32A32_SFLOAT);
CAN_RENDER_TARGET_WRITE(R8_UNORM); // this has a subscript 8 which makes no sense
CAN_RENDER_TARGET_WRITE(R8_SNORM);
CAN_RENDER_TARGET_WRITE(R8_UINT);
CAN_RENDER_TARGET_WRITE(R8_SINT);

CAN_RENDER_TARGET_WRITE(R16_UNORM);
CAN_RENDER_TARGET_WRITE(R16_SNORM);
CAN_RENDER_TARGET_WRITE(R16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R16_UINT);
CAN_RENDER_TARGET_WRITE(R16_SINT);

CAN_RENDER_TARGET_WRITE(R8G8_UNORM);
CAN_RENDER_TARGET_WRITE(R8G8_SNORM);
CAN_RENDER_TARGET_WRITE(R8G8_UINT);
CAN_RENDER_TARGET_WRITE(R8G8_SINT);

CAN_RENDER_TARGET_WRITE(R8G8B8A8_UNORM);
CAN_RENDER_TARGET_WRITE(R8G8B8A8_SNORM);
CAN_RENDER_TARGET_WRITE(R8G8B8A8_SRGB);
CAN_RENDER_TARGET_WRITE(B8G8R8A8_UNORM);
CAN_RENDER_TARGET_WRITE(B8G8R8A8_SRGB);
CAN_RENDER_TARGET_WRITE(R16G16_UNORM);
CAN_RENDER_TARGET_WRITE(R16G16_SNORM);
CAN_RENDER_TARGET_WRITE(R16G16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R32_SFLOAT);
CAN_RENDER_TARGET_WRITE(A2R10G10B10_UNORM);
CAN_RENDER_TARGET_WRITE(A2B10G10R10_UNORM);
CAN_RENDER_TARGET_WRITE(B10G11R11_UFLOAT);

CAN_RENDER_TARGET_WRITE(R16G16B16A16_UNORM);
CAN_RENDER_TARGET_WRITE(R16G16B16A16_SNORM);
CAN_RENDER_TARGET_WRITE(R16G16B16A16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R32G32_SFLOAT);

CAN_RENDER_TARGET_WRITE(R32G32B32A32_SFLOAT);

CAN_RENDER_TARGET_WRITE(D16_UNORM);
CAN_RENDER_TARGET_WRITE(D32_SFLOAT);
CAN_RENDER_TARGET_WRITE(S8_UINT);
CAN_RENDER_TARGET_WRITE(D32_SFLOAT_S8_UINT);
};

bool depth24Stencil8Supported = [pRenderer->pDevice isDepth24Stencil8PixelFormatSupported];

pRenderer->capBits.canShaderReadFrom[TinyImageFormat_D24_UNORM_S8_UINT] = depth24Stencil8Supported;
pRenderer->capBits.canShaderReadFrom[TinyImageFormat_X8_D24_UNORM] = depth24Stencil8Supported;
pRenderer->capBits.canShaderWriteTo[TinyImageFormat_D24_UNORM_S8_UINT] = depth24Stencil8Supported;
pRenderer->capBits.canShaderWriteTo[TinyImageFormat_X8_D24_UNORM] = depth24Stencil8Supported;
pRenderer->capBits.canRenderTargetWriteTo[TinyImageFormat_D24_UNORM_S8_UINT] = depth24Stencil8Supported;
pRenderer->capBits.canRenderTargetWriteTo[TinyImageFormat_X8_D24_UNORM] = depth24Stencil8Supported;

#else // iOS
uint32_t familyTier = 0;
familyTier = [pRenderer->pDevice supportsFeatureSet: MTLFeatureSet_iOS_GPUFamily1_v1] ? 1 : familyTier;
Expand Down Expand Up @@ -159,53 +174,63 @@ inline void utils_caps_builder(Renderer* pRenderer) {
}

if(familyTier >= 1) {
CAN_COLOR_WRITE(R8_UNORM); // this has a subscript 8 which makes no sense
CAN_COLOR_WRITE(R8_SNORM);
CAN_COLOR_WRITE(R8_UINT);
CAN_COLOR_WRITE(R8_SINT);
CAN_COLOR_WRITE(R8_SRGB);

CAN_COLOR_WRITE(R16_UNORM);
CAN_COLOR_WRITE(R16_SNORM);
CAN_COLOR_WRITE(R16_SFLOAT);
CAN_COLOR_WRITE(R16_UINT);
CAN_COLOR_WRITE(R16_SINT);

CAN_COLOR_WRITE(R8G8_UNORM);
CAN_COLOR_WRITE(R8G8_SNORM);
CAN_COLOR_WRITE(R8G8_SRGB);
CAN_COLOR_WRITE(R8G8_UINT);
CAN_COLOR_WRITE(R8G8_SINT);

CAN_COLOR_WRITE(B5G6R5_UNORM);
CAN_COLOR_WRITE(A1R5G5B5_UNORM);
CAN_COLOR_WRITE(A4B4G4R4_UNORM);
CAN_COLOR_WRITE(R5G6B5_UNORM);
CAN_COLOR_WRITE(B5G5R5A1_UNORM);

CAN_COLOR_WRITE(R8G8B8A8_UNORM);
CAN_COLOR_WRITE(R8G8B8A8_SNORM);
CAN_COLOR_WRITE(R8G8B8A8_SRGB);
CAN_COLOR_WRITE(B8G8R8A8_UNORM);
CAN_COLOR_WRITE(B8G8R8A8_SRGB);
CAN_COLOR_WRITE(R16G16_UNORM);
CAN_COLOR_WRITE(R16G16_SNORM);
CAN_COLOR_WRITE(R16G16_SFLOAT);
CAN_COLOR_WRITE(R32_SFLOAT);
CAN_COLOR_WRITE(A2R10G10B10_UNORM);
CAN_COLOR_WRITE(A2B10G10R10_UNORM);
CAN_COLOR_WRITE(B10G11R11_UFLOAT);

CAN_COLOR_WRITE(R16G16B16A16_UNORM);
CAN_COLOR_WRITE(R16G16B16A16_SNORM);
CAN_COLOR_WRITE(R16G16B16A16_SFLOAT);
CAN_COLOR_WRITE(R32G32_SFLOAT);

CAN_COLOR_WRITE(R32G32B32A32_SFLOAT);
CAN_RENDER_TARGET_WRITE(R8_UNORM); // this has a subscript 8 which makes no sense
CAN_RENDER_TARGET_WRITE(R8_SNORM);
CAN_RENDER_TARGET_WRITE(R8_UINT);
CAN_RENDER_TARGET_WRITE(R8_SINT);
CAN_RENDER_TARGET_WRITE(R8_SRGB);

CAN_RENDER_TARGET_WRITE(R16_UNORM);
CAN_RENDER_TARGET_WRITE(R16_SNORM);
CAN_RENDER_TARGET_WRITE(R16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R16_UINT);
CAN_RENDER_TARGET_WRITE(R16_SINT);

CAN_RENDER_TARGET_WRITE(R8G8_UNORM);
CAN_RENDER_TARGET_WRITE(R8G8_SNORM);
CAN_RENDER_TARGET_WRITE(R8G8_SRGB);
CAN_RENDER_TARGET_WRITE(R8G8_UINT);
CAN_RENDER_TARGET_WRITE(R8G8_SINT);

CAN_RENDER_TARGET_WRITE(B5G6R5_UNORM);
CAN_RENDER_TARGET_WRITE(A1R5G5B5_UNORM);
CAN_RENDER_TARGET_WRITE(A4B4G4R4_UNORM);
CAN_RENDER_TARGET_WRITE(R5G6B5_UNORM);
CAN_RENDER_TARGET_WRITE(B5G5R5A1_UNORM);

CAN_RENDER_TARGET_WRITE(R8G8B8A8_UNORM);
CAN_RENDER_TARGET_WRITE(R8G8B8A8_SNORM);
CAN_RENDER_TARGET_WRITE(R8G8B8A8_SRGB);
CAN_RENDER_TARGET_WRITE(B8G8R8A8_UNORM);
CAN_RENDER_TARGET_WRITE(B8G8R8A8_SRGB);
CAN_RENDER_TARGET_WRITE(R16G16_UNORM);
CAN_RENDER_TARGET_WRITE(R16G16_SNORM);
CAN_RENDER_TARGET_WRITE(R16G16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R32_SFLOAT);
CAN_RENDER_TARGET_WRITE(A2R10G10B10_UNORM);
CAN_RENDER_TARGET_WRITE(A2B10G10R10_UNORM);
CAN_RENDER_TARGET_WRITE(B10G11R11_UFLOAT);

CAN_RENDER_TARGET_WRITE(R16G16B16A16_UNORM);
CAN_RENDER_TARGET_WRITE(R16G16B16A16_SNORM);
CAN_RENDER_TARGET_WRITE(R16G16B16A16_SFLOAT);
CAN_RENDER_TARGET_WRITE(R32G32_SFLOAT);

CAN_RENDER_TARGET_WRITE(R32G32B32A32_SFLOAT);

CAN_RENDER_TARGET_WRITE(D32_SFLOAT);
CAN_RENDER_TARGET_WRITE(S8_UINT);
CAN_RENDER_TARGET_WRITE(D32_SFLOAT_S8_UINT);
CAN_RENDER_TARGET_WRITE(D32_SFLOAT_S8_UINT);
}

if (@available(iOS 13, *)) {
pRenderer->capBits.canShaderWriteTo[TinyImageFormat_D16_UNORM] = true;
pRenderer->capBits.canRenderTargetWriteTo[TinyImageFormat_D16_UNORM] = true;
}

#endif

#undef CAN_SHADER_WRITE
#undef CAN_COLOR_WRITE
#undef CAN_RENDER_TARGET_WRITE
}
30 changes: 23 additions & 7 deletions Common_3/Renderer/Metal/MetalMemoryAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3521,7 +3521,7 @@ long createBuffer(
{
pBuffer->mtlBuffer = [pBuffer->pMtlAllocation->GetMemory() newBufferWithLength:pCreateInfo->mSize options:mtlResourceOptions];
assert(pBuffer->mtlBuffer);
pBuffer->mtlBuffer.label = [NSString stringWithFormat:@"Placed Buffer %llx", (uint64_t)pBuffer->mtlBuffer];
pBuffer->mtlBuffer.label = [NSString stringWithFormat:@"Placed Buffer %p", pBuffer->mtlBuffer];

if (pMemoryRequirements->flags & RESOURCE_MEMORY_REQUIREMENT_PERSISTENT_MAP_BIT)
{
Expand All @@ -3541,7 +3541,7 @@ long createBuffer(
{
pBuffer->mtlBuffer = [allocator->m_Device newBufferWithLength:pCreateInfo->mSize options:mtlResourceOptions];
assert(pBuffer->mtlBuffer);
pBuffer->mtlBuffer.label = [NSString stringWithFormat:@"Owned Buffer %llx", (uint64_t)pBuffer->mtlBuffer];
pBuffer->mtlBuffer.label = [NSString stringWithFormat:@"Owned Buffer %p", pBuffer->mtlBuffer];

if (pMemoryRequirements->flags & RESOURCE_MEMORY_REQUIREMENT_PERSISTENT_MAP_BIT &&
pMemoryRequirements->usage != RESOURCE_MEMORY_USAGE_GPU_ONLY)
Expand All @@ -3552,7 +3552,7 @@ long createBuffer(

if (pCreateInfo->pDebugName)
{
pBuffer->mtlBuffer.label = [[[NSString alloc] initWithBytesNoCopy:(void*)pCreateInfo->pDebugName length: wcslen(pCreateInfo->pDebugName)*4 encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO] stringByAppendingFormat:@" %llx", (uint64_t)pBuffer->mtlBuffer];
pBuffer->mtlBuffer.label = [[[NSString alloc] initWithBytesNoCopy:(void*)pCreateInfo->pDebugName length: wcslen(pCreateInfo->pDebugName)*4 encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO] stringByAppendingFormat:@" %p", pBuffer->mtlBuffer];
}

// Bind buffer with memory.
Expand Down Expand Up @@ -3603,7 +3603,23 @@ long createTexture(
AllocatorSuballocationType suballocType;
if (!resourceAllocFindSuballocType(pCreateInfo->pDesc, &suballocType))
return false;


#ifdef TARGET_IOS
// For memoryless textures, avoid a heap allocation.
if ([pCreateInfo->pDesc storageMode] == MTLStorageModeMemoryless)
{
pTexture->mtlTexture = [allocator->m_Device newTextureWithDescriptor:pCreateInfo->pDesc];
assert(pTexture->mtlTexture);
pTexture->mtlTexture.label = [NSString stringWithFormat:@"Memoryless Texture %p", pTexture->mtlTexture];

if (pCreateInfo->pDebugName)
{
pTexture->mtlTexture.label = [[NSString alloc] initWithBytesNoCopy:(void*)pCreateInfo->pDebugName length: wcslen(pCreateInfo->pDebugName)*4 encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO];
}
return true;
}
#endif

// Allocate memory using allocator.
AllocationInfo info;
info.mSizeAlign = [allocator->m_Device heapTextureSizeAndAlignWithDescriptor:pCreateInfo->pDesc];
Expand All @@ -3617,18 +3633,18 @@ long createTexture(
{
pTexture->mtlTexture = [pTexture->pMtlAllocation->GetMemory() newTextureWithDescriptor:pCreateInfo->pDesc];
assert(pTexture->mtlTexture);
pTexture->mtlTexture.label = [NSString stringWithFormat:@"Placed Texture %llx", (uint64_t)pTexture->mtlTexture];
pTexture->mtlTexture.label = [NSString stringWithFormat:@"Placed Texture %p", pTexture->mtlTexture];
}
else
{
pTexture->mtlTexture = [allocator->m_Device newTextureWithDescriptor:pCreateInfo->pDesc];
assert(pTexture->mtlTexture);
pTexture->mtlTexture.label = [NSString stringWithFormat:@"Owned Texture %llx", (uint64_t)pTexture->mtlTexture];
pTexture->mtlTexture.label = [NSString stringWithFormat:@"Owned Texture %p", pTexture->mtlTexture];
}

if (pCreateInfo->pDebugName)
{
pTexture->mtlTexture.label = [[[NSString alloc] initWithBytesNoCopy:(void*)pCreateInfo->pDebugName length: wcslen(pCreateInfo->pDebugName)*4 encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO] stringByAppendingFormat:@" %llx", (uint64_t)pTexture->mtlTexture];
pTexture->mtlTexture.label = [[[NSString alloc] initWithBytesNoCopy:(void*)pCreateInfo->pDebugName length: wcslen(pCreateInfo->pDebugName)*4 encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO] stringByAppendingFormat:@" %p", pTexture->mtlTexture];
//[pTexture->mtlTexture.label ];
}

Expand Down
Loading

0 comments on commit ad6deea

Please sign in to comment.