mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
Code review feedback
This commit is contained in:
parent
3eed3ae913
commit
9a9fb5e39e
@ -1539,23 +1539,19 @@ namespace
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
void SetDebugTextureInfo(
|
void SetDebugTextureInfo(
|
||||||
_In_z_ const wchar_t* fileName,
|
_In_z_ const wchar_t* fileName,
|
||||||
_In_ ID3D12Resource** texture) noexcept
|
_In_ ID3D12Resource* texture) noexcept
|
||||||
{
|
{
|
||||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||||
if (texture && *texture)
|
const wchar_t* pstrName = wcsrchr(fileName, '\\');
|
||||||
|
if (!pstrName)
|
||||||
{
|
{
|
||||||
const wchar_t* pstrName = wcsrchr(fileName, '\\');
|
pstrName = fileName;
|
||||||
if (!pstrName)
|
|
||||||
{
|
|
||||||
pstrName = fileName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pstrName++;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*texture)->SetName(pstrName);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pstrName++;
|
||||||
|
}
|
||||||
|
texture->SetName(pstrName);
|
||||||
#else
|
#else
|
||||||
UNREFERENCED_PARAMETER(fileName);
|
UNREFERENCED_PARAMETER(fileName);
|
||||||
UNREFERENCED_PARAMETER(texture);
|
UNREFERENCED_PARAMETER(texture);
|
||||||
@ -1643,10 +1639,7 @@ HRESULT DirectX::LoadDDSTextureFromMemoryEx(
|
|||||||
texture, subresources, isCubeMap);
|
texture, subresources, isCubeMap);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
if (texture && *texture)
|
SetDebugObjectName(*texture, L"DDSTextureLoader");
|
||||||
{
|
|
||||||
SetDebugObjectName(*texture, L"DDSTextureLoader");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alphaMode)
|
if (alphaMode)
|
||||||
*alphaMode = GetAlphaMode(header);
|
*alphaMode = GetAlphaMode(header);
|
||||||
@ -1734,7 +1727,7 @@ HRESULT DirectX::LoadDDSTextureFromFileEx(
|
|||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
SetDebugTextureInfo(fileName, texture);
|
SetDebugTextureInfo(fileName, *texture);
|
||||||
|
|
||||||
if (alphaMode)
|
if (alphaMode)
|
||||||
*alphaMode = GetAlphaMode(header);
|
*alphaMode = GetAlphaMode(header);
|
||||||
|
@ -640,23 +640,19 @@ namespace
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
void SetDebugTextureInfo(
|
void SetDebugTextureInfo(
|
||||||
_In_z_ const wchar_t* fileName,
|
_In_z_ const wchar_t* fileName,
|
||||||
_In_ ID3D12Resource** texture) noexcept
|
_In_ ID3D12Resource* texture) noexcept
|
||||||
{
|
{
|
||||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||||
if (texture && *texture)
|
const wchar_t* pstrName = wcsrchr(fileName, '\\');
|
||||||
|
if (!pstrName)
|
||||||
{
|
{
|
||||||
const wchar_t* pstrName = wcsrchr(fileName, '\\');
|
pstrName = fileName;
|
||||||
if (!pstrName)
|
|
||||||
{
|
|
||||||
pstrName = fileName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pstrName++;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*texture)->SetName(pstrName);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pstrName++;
|
||||||
|
}
|
||||||
|
texture->SetName(pstrName);
|
||||||
#else
|
#else
|
||||||
UNREFERENCED_PARAMETER(fileName);
|
UNREFERENCED_PARAMETER(fileName);
|
||||||
UNREFERENCED_PARAMETER(texture);
|
UNREFERENCED_PARAMETER(texture);
|
||||||
@ -822,7 +818,7 @@ HRESULT DirectX::LoadWICTextureFromFileEx(
|
|||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
SetDebugTextureInfo(fileName, texture);
|
SetDebugTextureInfo(fileName, *texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user