summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src/TestComputeShaders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/TestApp/src/TestComputeShaders.cpp')
-rw-r--r--Tests/TestApp/src/TestComputeShaders.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/TestApp/src/TestComputeShaders.cpp b/Tests/TestApp/src/TestComputeShaders.cpp
index 43c6dd0..2461a51 100644
--- a/Tests/TestApp/src/TestComputeShaders.cpp
+++ b/Tests/TestApp/src/TestComputeShaders.cpp
@@ -31,12 +31,19 @@
using namespace Diligent;
-TestComputeShaders::TestComputeShaders()
+TestComputeShaders::TestComputeShaders() :
+ UnitTestBase("Compute shader test")
{
}
void TestComputeShaders::Init( IRenderDevice *pDevice, IDeviceContext *pContext )
{
+ if(!pDevice->GetDeviceCaps().bComputeShadersSupported)
+ {
+ SetStatus(TestResult::Skipped, "Compute shaders are not supported");
+ return;
+ }
+
m_pRenderDevice = pDevice;
m_pDeviceContext = pContext;
m_pRenderScript = CreateRenderScriptFromFile( "TestComputeShaders.lua", pDevice, pContext, []( ScriptParser *pScriptParser )
@@ -46,5 +53,8 @@ void TestComputeShaders::Init( IRenderDevice *pDevice, IDeviceContext *pContext
void TestComputeShaders::Draw()
{
+ if(!m_pDeviceContext)
+ return;
+
m_pRenderScript->Run( m_pDeviceContext, "Render" );
}