Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jp7677/dxvk-nvapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam Middlebrook <lmiddlebrook@nvidia.com>2021-10-05 00:14:31 +0300
committerJens Peters <jp7677@gmail.com>2021-10-05 00:46:58 +0300
commite9c840916ac2ea96e1807f6382eef8cdb4a2ede8 (patch)
tree8508e39fb73e163d78ec15286e515e28c4cff6bf
parenta3e0ecce70ce0eccf45bcd5d270411faa8befce8 (diff)
nvapi-d3d12: Improve logging for NvAPI_D3D12_CreateCubinComputeShader
Change the logging behavior for NvAPI_D3D12_CreateCubinComputeShader to distinguish from NvAPI_D3D12_CreateCubinComputeShaderWithName. This matches the logging behavior for the functions of similar names for NvAPI_D3D11.
-rw-r--r--src/nvapi_d3d12.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvapi_d3d12.cpp b/src/nvapi_d3d12.cpp
index 7799150..3c2a795 100644
--- a/src/nvapi_d3d12.cpp
+++ b/src/nvapi_d3d12.cpp
@@ -35,7 +35,17 @@ extern "C" {
}
NvAPI_Status __cdecl NvAPI_D3D12_CreateCubinComputeShader(ID3D12Device* pDevice, const void* cubinData, NvU32 cubinSize, NvU32 blockX, NvU32 blockY, NvU32 blockZ, NVDX_ObjectHandle* pShader) {
- return NvAPI_D3D12_CreateCubinComputeShaderWithName(pDevice, cubinData, cubinSize, blockX, blockY, blockZ, "", pShader);
+ constexpr auto n = __func__;
+ static bool alreadyLoggedError = false;
+ static bool alreadyLoggedOk = false;
+
+ if (pDevice == nullptr)
+ return InvalidArgument(n);
+
+ if (!NvapiD3d12Device::CreateCubinComputeShaderWithName(pDevice, cubinData, cubinSize, blockX, blockY, blockZ, "", pShader))
+ return Error(n, alreadyLoggedError);
+
+ return Ok(n, alreadyLoggedOk);
}
NvAPI_Status __cdecl NvAPI_D3D12_DestroyCubinComputeShader(ID3D12Device* pDevice, NVDX_ObjectHandle pShader) {