summaryrefslogtreecommitdiffstats
path: root/tools/gfx-unit-test/gfx-test-util.cpp
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-10-19 09:36:41 -0700
committerGitHub <noreply@github.com>2022-10-19 09:36:41 -0700
commitdec930150f42a22892e567c769a1c9e24e761fde (patch)
tree92eea81e0c5d08c2c5ff090e7ebb0c2030648912 /tools/gfx-unit-test/gfx-test-util.cpp
parent8add41a6e37994577d928bc312801ddfa1c33173 (diff)
PersistentShaderCache integration (#2453)
* Shader cache index integrated into RendererBase; Added test for cache eviction policy (which currently does not pass) * Restructured main if block in getEntryPointCodeFromShaderCache; Post-rebase cleanup * undo local testing only change * Fixed issues causing shader cache tests to fail * Edited gfx.slang to reflect structural changes to IDevice::Desc and to include ShaderCacheDesc; Modified how the cache is reading in the file from disk; Added a check to the cache eviction policy test that checks for correct order of entries in the cache as well as eight total expected output files for D3D12 and Vulkan * Removed line in gfx-unit-test.cpp for local testing * Edited .gitignore to ignore all shaders automatically generated by the shader cache tests and removed the test shaders that were previously added; Review changes, most notably with an overhaul of how the cache eviction policy test handles checking order of entries * Ran premake; Removed local testing specific line (again) * Removed expected comparison files from earlier commit; Ran premake * Edited premake5.lua to also ignore the auto-generated shader files from specific shader cache tests * Fixed weird indent in premake5.lua
Diffstat (limited to 'tools/gfx-unit-test/gfx-test-util.cpp')
-rw-r--r--tools/gfx-unit-test/gfx-test-util.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp
index 90aec2647..fa0745872 100644
--- a/tools/gfx-unit-test/gfx-test-util.cpp
+++ b/tools/gfx-unit-test/gfx-test-util.cpp
@@ -176,7 +176,10 @@ namespace gfx_test
compareComputeResultFuzzy(result, expectedResult, expectedBufferSize);
}
- Slang::ComPtr<gfx::IDevice> createTestingDevice(UnitTestContext* context, Slang::RenderApiFlag::Enum api, ISlangMutableFileSystem* fileSystem)
+ Slang::ComPtr<gfx::IDevice> createTestingDevice(
+ UnitTestContext* context,
+ Slang::RenderApiFlag::Enum api,
+ gfx::IDevice::ShaderCacheDesc shaderCache)
{
Slang::ComPtr<gfx::IDevice> device;
gfx::IDevice::Desc deviceDesc = {};
@@ -208,6 +211,8 @@ namespace gfx_test
deviceDesc.slang.searchPathCount = (SlangInt)SLANG_COUNT_OF(searchPaths);
deviceDesc.slang.searchPaths = searchPaths;
+ deviceDesc.shaderCache = shaderCache;
+
gfx::D3D12DeviceExtendedDesc extDesc = {};
extDesc.rootParameterShaderAttributeName = "root";
@@ -215,11 +220,6 @@ namespace gfx_test
void* extDescPtr = &extDesc;
deviceDesc.extendedDescs = &extDescPtr;
- if (fileSystem)
- {
- deviceDesc.shaderCacheFileSystem = fileSystem;
- }
-
auto createDeviceResult = gfxCreateDevice(&deviceDesc, device.writeRef());
if (SLANG_FAILED(createDeviceResult))
{