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
path: root/tests
diff options
context:
space:
mode:
authorJens Peters <jp7677@gmail.com>2022-06-06 12:12:55 +0300
committerJens Peters <jp7677@gmail.com>2022-06-06 12:12:55 +0300
commitaa83ae9be28fabdddb815614484ebb20349a20c7 (patch)
treeceff6e7fdebe43141410fd3822a250be8cd564e5 /tests
parentad6df3dd593a1c5c79d476ac6193093fc1ec84a9 (diff)
tests: Split test
Diffstat (limited to 'tests')
-rw-r--r--tests/nvapi_d3d12.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/nvapi_d3d12.cpp b/tests/nvapi_d3d12.cpp
index fa969bf..9912c59 100644
--- a/tests/nvapi_d3d12.cpp
+++ b/tests/nvapi_d3d12.cpp
@@ -275,15 +275,32 @@ TEST_CASE("D3D12 methods succeed", "[.d3d12]") {
auto blockX = 3U;
auto blockY = 4U;
auto blockZ = 5U;
- const char* shaderName = "";
+ auto shaderHandle = reinterpret_cast<D3D12_CUBIN_DATA_HANDLE*>(0x912122);
+ auto handle = &shaderHandle;
+ REQUIRE_CALL(device, CreateCubinComputeShaderWithName(cubinData, cubinSize, blockX, blockY, blockZ, _, handle))
+ .WITH(_6 == std::string(""))
+ .RETURN(S_OK)
+ .TIMES(1);
+
+ REQUIRE(NvAPI_D3D12_CreateCubinComputeShader(static_cast<ID3D12Device*>(&device), cubinData, cubinSize, blockX, blockY, blockZ, reinterpret_cast<NVDX_ObjectHandle*>(handle)) == NVAPI_OK);
+ REQUIRE(deviceRefCount == 0);
+ REQUIRE(commandListRefCount == 0);
+ }
+
+ SECTION("CreateCubinComputeShaderWithName returns OK") {
+ const void* cubinData = nullptr;
+ auto cubinSize = 2U;
+ auto blockX = 3U;
+ auto blockY = 4U;
+ auto blockZ = 5U;
+ auto shaderName = "shader";
auto shaderHandle = reinterpret_cast<D3D12_CUBIN_DATA_HANDLE*>(0x912122);
auto handle = &shaderHandle;
REQUIRE_CALL(device, CreateCubinComputeShaderWithName(cubinData, cubinSize, blockX, blockY, blockZ, shaderName, handle))
.RETURN(S_OK)
- .TIMES(2);
+ .TIMES(1);
REQUIRE(NvAPI_D3D12_CreateCubinComputeShaderWithName(static_cast<ID3D12Device*>(&device), cubinData, cubinSize, blockX, blockY, blockZ, shaderName, reinterpret_cast<NVDX_ObjectHandle*>(handle)) == NVAPI_OK);
- REQUIRE(NvAPI_D3D12_CreateCubinComputeShader(static_cast<ID3D12Device*>(&device), cubinData, cubinSize, blockX, blockY, blockZ, reinterpret_cast<NVDX_ObjectHandle*>(handle)) == NVAPI_OK);
REQUIRE(deviceRefCount == 0);
REQUIRE(commandListRefCount == 0);
}