summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-05-07 15:25:35 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-05-07 15:25:35 +0000
commit5ad9be30fe2e3bceca2d5b1f00afd35a7ced67a8 (patch)
treeb406a1ab31a450d64457668ccf92aa31541b198e /Tests/TestApp
parentUpdated core submodule (diff)
downloadDiligentEngine-5ad9be30fe2e3bceca2d5b1f00afd35a7ced67a8.tar.gz
DiligentEngine-5ad9be30fe2e3bceca2d5b1f00afd35a7ced67a8.zip
Test app: added shader resource layout initialization test; updated gl shaders
Diffstat (limited to 'Tests/TestApp')
-rw-r--r--Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl2
-rw-r--r--Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.psh101
-rw-r--r--Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.vsh112
-rw-r--r--Tests/TestApp/assets/Shaders/SpriteGL.psh2
-rw-r--r--Tests/TestApp/assets/Shaders/TextureIntTestGL.psh2
-rw-r--r--Tests/TestApp/assets/Shaders/TextureTestGL.psh2
-rw-r--r--Tests/TestApp/assets/Shaders/UniformBufferGL.psh2
-rw-r--r--Tests/TestApp/assets/Shaders/minimalGL.psh4
-rw-r--r--Tests/TestApp/assets/TestComputeShaders.lua4
-rw-r--r--Tests/TestApp/include/TestShaderResourceLayout.h35
-rw-r--r--Tests/TestApp/src/TestShaderResourceLayout.cpp101
11 files changed, 358 insertions, 9 deletions
diff --git a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
index e90ff5c..2139000 100644
--- a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
+++ b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
@@ -5,7 +5,7 @@ uniform sampler2D g_tex2DTest2;
layout(location = 1)in vec2 ex_UV;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main()
{
diff --git a/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.psh b/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.psh
new file mode 100644
index 0000000..3d93044
--- /dev/null
+++ b/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.psh
@@ -0,0 +1,101 @@
+// Fragment Shader – file "minimal.frag"
+
+uniform sampler2D g_tex2D_Static;
+uniform sampler2D g_tex2DArr_Static[2];
+uniform sampler2D g_tex2D_Mut;
+uniform sampler2D g_tex2DArr_Mut[3];
+uniform sampler2D g_tex2D_Dyn;
+uniform sampler2D g_tex2DArr_Dyn[4];
+
+uniform UniformBuff_Stat
+{
+ vec2 UV;
+}g_UniformBuff_Stat;
+
+uniform UniformBuffArr_Stat
+{
+ vec2 UV;
+}g_UniformBuffArr_Stat[2];
+
+uniform UniformBuff_Dyn
+{
+ vec2 UV;
+}g_UniformBuff_Dyn;
+
+uniform UniformBuffArr_Dyn
+{
+ vec2 UV;
+}g_UniformBuffArr_Dyn[4];
+
+uniform UniformBuff_Mut
+{
+ vec2 UV;
+}g_UniformBuff_Mut;
+
+uniform UniformBuffArr_Mut
+{
+ vec2 UV;
+}g_UniformBuffArr_Mut[3];
+
+layout(std140) buffer storageBuff_Static
+{
+ vec4 UV[];
+}g_StorageBuff_Stat;
+
+layout(std140) buffer storageBuffArr_Static
+{
+ vec4 UV[];
+}g_StorageBuffArr_Stat[2];
+
+layout(std140) buffer storageBuff_Dyn
+{
+ vec4 UV[];
+}g_StorageBuff_Dyn;
+
+layout(std140) buffer storageBuffArr_Dyn
+{
+ vec4 UV[];
+}g_StorageBuffArr_Dyn[4];
+
+layout(std140) buffer storageBuff_Mut
+{
+ vec4 UV[];
+}g_StorageBuff_Mut;
+
+layout(std140) buffer storageBuffArr_Mut
+{
+ vec4 UV[];
+}g_StorageBuffArr_Mut[3];
+
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImg_Stat;
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImgArr_Mut[2];
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImgArr_Dyn[2];
+
+layout(location = 0)in vec4 in_Color;
+layout(location = 0)out vec4 out_Color;
+
+void main(void)
+{
+ out_Color = in_Color;
+
+ out_Color += textureLod(g_tex2D_Static, g_UniformBuff_Stat.UV + g_StorageBuff_Stat.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Static[0], g_UniformBuffArr_Stat[0].UV + g_StorageBuffArr_Stat[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Static[1], g_UniformBuffArr_Stat[1].UV + g_StorageBuffArr_Stat[1].UV[0].xy, 0.0);
+
+ out_Color += textureLod(g_tex2D_Mut, g_UniformBuff_Mut.UV + g_StorageBuff_Mut.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[0], g_UniformBuffArr_Mut[0].UV + g_StorageBuffArr_Mut[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[1], g_UniformBuffArr_Mut[1].UV + g_StorageBuffArr_Mut[1].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[2], g_UniformBuffArr_Mut[2].UV + g_StorageBuffArr_Mut[2].UV[0].xy, 0.0);
+
+ out_Color += textureLod(g_tex2D_Dyn, g_UniformBuff_Dyn.UV + g_StorageBuff_Dyn.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[0], g_UniformBuffArr_Dyn[0].UV + g_StorageBuffArr_Dyn[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[1], g_UniformBuffArr_Dyn[1].UV + g_StorageBuffArr_Dyn[1].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[2], g_UniformBuffArr_Dyn[2].UV + g_StorageBuffArr_Dyn[2].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[3], g_UniformBuffArr_Dyn[3].UV + g_StorageBuffArr_Dyn[3].UV[0].xy, 0.0);
+
+ imageStore(g_tex2DStorageImg_Stat, ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Mut[0], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Mut[1], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Dyn[0], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Dyn[1], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+}
diff --git a/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.vsh b/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.vsh
new file mode 100644
index 0000000..441bf59
--- /dev/null
+++ b/Tests/TestApp/assets/Shaders/ShaderResLayoutTestGL.vsh
@@ -0,0 +1,112 @@
+
+uniform sampler2D g_tex2D_Static;
+uniform sampler2D g_tex2DArr_Static[2];
+uniform sampler2D g_tex2D_Mut;
+uniform sampler2D g_tex2DArr_Mut[3];
+uniform sampler2D g_tex2D_Dyn;
+uniform sampler2D g_tex2DArr_Dyn[4];
+
+uniform UniformBuff_Stat
+{
+ vec2 UV;
+}g_UniformBuff_Stat;
+
+uniform UniformBuffArr_Stat
+{
+ vec2 UV;
+}g_UniformBuffArr_Stat[2];
+
+uniform UniformBuff_Dyn
+{
+ vec2 UV;
+}g_UniformBuff_Dyn;
+
+uniform UniformBuffArr_Dyn
+{
+ vec2 UV;
+}g_UniformBuffArr_Dyn[4];
+
+uniform UniformBuff_Mut
+{
+ vec2 UV;
+}g_UniformBuff_Mut;
+
+uniform UniformBuffArr_Mut
+{
+ vec2 UV;
+}g_UniformBuffArr_Mut[3];
+
+layout(std140) buffer storageBuff_Static
+{
+ vec4 UV[];
+}g_StorageBuff_Stat;
+
+layout(std140) buffer storageBuffArr_Static
+{
+ vec4 UV[];
+}g_StorageBuffArr_Stat[2];
+
+layout(std140) buffer storageBuff_Dyn
+{
+ vec4 UV[];
+}g_StorageBuff_Dyn;
+
+layout(std140) buffer storageBuffArr_Dyn
+{
+ vec4 UV[];
+}g_StorageBuffArr_Dyn[4];
+
+layout(std140) buffer storageBuff_Mut
+{
+ vec4 UV[];
+}g_StorageBuff_Mut;
+
+layout(std140) buffer storageBuffArr_Mut
+{
+ vec4 UV[];
+}g_StorageBuffArr_Mut[3];
+
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImg_Stat;
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImgArr_Mut[2];
+layout(rgba8) uniform writeonly image2D g_tex2DStorageImgArr_Dyn[2];
+
+layout(location = 0) out vec4 out_Color;
+
+//To use any built-in input or output in the gl_PerVertex and
+//gl_PerFragment blocks in separable program objects, shader code must
+//redeclare those blocks prior to use.
+//
+// Declaring this block causes compilation error on NVidia GLES
+#ifndef GL_ES
+out gl_PerVertex
+{
+ vec4 gl_Position;
+};
+#endif
+
+void main(void)
+{
+ out_Color = vec4(0.0, 0.0, 0.0, 0.0);
+ out_Color += textureLod(g_tex2D_Static, g_UniformBuff_Stat.UV + g_StorageBuff_Stat.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Static[0], g_UniformBuffArr_Stat[0].UV + g_StorageBuffArr_Stat[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Static[1], g_UniformBuffArr_Stat[1].UV + g_StorageBuffArr_Stat[1].UV[0].xy, 0.0);
+
+ out_Color += textureLod(g_tex2D_Mut, g_UniformBuff_Mut.UV + g_StorageBuff_Mut.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[0], g_UniformBuffArr_Mut[0].UV + g_StorageBuffArr_Mut[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[1], g_UniformBuffArr_Mut[1].UV + g_StorageBuffArr_Mut[1].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Mut[2], g_UniformBuffArr_Mut[2].UV + g_StorageBuffArr_Mut[2].UV[0].xy, 0.0);
+
+ out_Color += textureLod(g_tex2D_Dyn, g_UniformBuff_Dyn.UV + g_StorageBuff_Dyn.UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[0], g_UniformBuffArr_Dyn[0].UV + g_StorageBuffArr_Dyn[0].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[1], g_UniformBuffArr_Dyn[1].UV + g_StorageBuffArr_Dyn[1].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[2], g_UniformBuffArr_Dyn[2].UV + g_StorageBuffArr_Dyn[2].UV[0].xy, 0.0);
+ out_Color += textureLod(g_tex2DArr_Dyn[3], g_UniformBuffArr_Dyn[3].UV + g_StorageBuffArr_Dyn[3].UV[0].xy, 0.0);
+
+ imageStore(g_tex2DStorageImg_Stat, ivec2(0,0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Mut[0], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Mut[1], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Dyn[0], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+ imageStore(g_tex2DStorageImgArr_Dyn[1], ivec2(0, 0), vec4(1.0, 2.0, 3.0, 4.0));
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
diff --git a/Tests/TestApp/assets/Shaders/SpriteGL.psh b/Tests/TestApp/assets/Shaders/SpriteGL.psh
index 557ec8e..f2bdd11 100644
--- a/Tests/TestApp/assets/Shaders/SpriteGL.psh
+++ b/Tests/TestApp/assets/Shaders/SpriteGL.psh
@@ -3,7 +3,7 @@
layout(location = 1)in vec2 in_UV;
uniform sampler2D g_tex2DTest;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main(void)
{
diff --git a/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh b/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh
index 114bcb4..003426d 100644
--- a/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh
+++ b/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh
@@ -3,7 +3,7 @@
layout(location = 1)in vec2 in_UV;
uniform isampler2D g_tex2DTest;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main(void)
{
diff --git a/Tests/TestApp/assets/Shaders/TextureTestGL.psh b/Tests/TestApp/assets/Shaders/TextureTestGL.psh
index 021f555..3f84f11 100644
--- a/Tests/TestApp/assets/Shaders/TextureTestGL.psh
+++ b/Tests/TestApp/assets/Shaders/TextureTestGL.psh
@@ -3,7 +3,7 @@
layout(location = 1)in vec2 in_UV;
uniform sampler2D g_tex2DTest;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main(void)
{
diff --git a/Tests/TestApp/assets/Shaders/UniformBufferGL.psh b/Tests/TestApp/assets/Shaders/UniformBufferGL.psh
index 5400a66..267e678 100644
--- a/Tests/TestApp/assets/Shaders/UniformBufferGL.psh
+++ b/Tests/TestApp/assets/Shaders/UniformBufferGL.psh
@@ -12,7 +12,7 @@ uniform cbTestBlock
vec4 Color;
}g_TestBlock;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main(void)
{
diff --git a/Tests/TestApp/assets/Shaders/minimalGL.psh b/Tests/TestApp/assets/Shaders/minimalGL.psh
index c39bb30..8aafaa2 100644
--- a/Tests/TestApp/assets/Shaders/minimalGL.psh
+++ b/Tests/TestApp/assets/Shaders/minimalGL.psh
@@ -1,8 +1,8 @@
// Fragment Shader – file "minimal.frag"
-layout(location = 1)in vec3 ex_Color;
+layout(location = 1) in vec3 ex_Color;
-out vec4 out_Color;
+layout(location = 0) out vec4 out_Color;
void main(void)
{
diff --git a/Tests/TestApp/assets/TestComputeShaders.lua b/Tests/TestApp/assets/TestComputeShaders.lua
index ad45095..3f8c6e4 100644
--- a/Tests/TestApp/assets/TestComputeShaders.lua
+++ b/Tests/TestApp/assets/TestComputeShaders.lua
@@ -235,8 +235,8 @@ RenderPSO = PipelineState.Create
pPS = RenderPS,
InputLayout =
{
- { InputIndex = 0, BufferSlot = 0, NumComponents = 3, ValueType = "VT_FLOAT32"},
- { InputIndex = 1, BufferSlot = 1, NumComponents = 2, ValueType = "VT_FLOAT32"}
+ { InputIndex = 0, BufferSlot = 0, NumComponents = 3, ValueType = "VT_FLOAT32", IsNormalized = false},
+ { InputIndex = 1, BufferSlot = 1, NumComponents = 2, ValueType = "VT_FLOAT32", IsNormalized = false}
},
RTVFormats = {"TEX_FORMAT_RGBA8_UNORM_SRGB"},
PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP"
diff --git a/Tests/TestApp/include/TestShaderResourceLayout.h b/Tests/TestApp/include/TestShaderResourceLayout.h
new file mode 100644
index 0000000..bc7d0ad
--- /dev/null
+++ b/Tests/TestApp/include/TestShaderResourceLayout.h
@@ -0,0 +1,35 @@
+/* Copyright 2015-2018 Egor Yusov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+#pragma once
+
+#include "UnitTestBase.h"
+
+class TestShaderResourceLayout : public UnitTestBase
+{
+public:
+ TestShaderResourceLayout( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext );
+
+private:
+ Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext;
+};
diff --git a/Tests/TestApp/src/TestShaderResourceLayout.cpp b/Tests/TestApp/src/TestShaderResourceLayout.cpp
new file mode 100644
index 0000000..d5b7954
--- /dev/null
+++ b/Tests/TestApp/src/TestShaderResourceLayout.cpp
@@ -0,0 +1,101 @@
+/* Copyright 2015-2018 Egor Yusov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+// EngineSandbox.cpp : Defines the entry point for the application.
+//
+
+#include "pch.h"
+#include "TestShaderResourceLayout.h"
+#include "BasicShaderSourceStreamFactory.h"
+
+using namespace Diligent;
+
+TestShaderResourceLayout::TestShaderResourceLayout( IRenderDevice *pDevice, IDeviceContext *pContext ) :
+ UnitTestBase("Shader resource layout initialization test"),
+ m_pDeviceContext(pContext)
+{
+ ShaderCreationAttribs CreationAttrs;
+ BasicShaderSourceStreamFactory BasicSSSFactory("Shaders");
+ CreationAttrs.pShaderSourceStreamFactory = &BasicSSSFactory;
+ CreationAttrs.EntryPoint = "main";
+
+ RefCntAutoPtr<IShader> pVS;
+ if(pDevice->GetDeviceCaps().DevType == DeviceType::Vulkan)
+ {
+ CreationAttrs.Desc.Name = "Shader resource layout test VS";
+ CreationAttrs.Desc.ShaderType = SHADER_TYPE_VERTEX;
+ CreationAttrs.SourceLanguage = SHADER_SOURCE_LANGUAGE_GLSL;
+ CreationAttrs.FilePath = "Shaders\\ShaderResLayoutTestGL.vsh";
+ ShaderVariableDesc VarDesc[] =
+ {
+ { "g_tex2D_Static", SHADER_VARIABLE_TYPE_STATIC },
+ { "g_tex2D_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "g_tex2D_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "g_tex2DArr_Static", SHADER_VARIABLE_TYPE_STATIC },
+ { "g_tex2DArr_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "g_tex2DArr_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "UniformBuff_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "UniformBuff_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "UniformBuffArr_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "UniformBuffArr_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "storageBuff_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "storageBuff_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "storageBuffArr_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "storageBuffArr_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "g_tex2DStorageImgArr_Mut", SHADER_VARIABLE_TYPE_MUTABLE },
+ { "g_tex2DStorageImgArr_Dyn", SHADER_VARIABLE_TYPE_DYNAMIC },
+ { "g_tex2DNoResourceTest", SHADER_VARIABLE_TYPE_DYNAMIC }
+ };
+ CreationAttrs.Desc.VariableDesc = VarDesc;
+ CreationAttrs.Desc.NumVariables = _countof(VarDesc);
+
+ pDevice->CreateShader(CreationAttrs, &pVS);
+ VERIFY_EXPR(pVS);
+ }
+
+ RefCntAutoPtr<IShader> pPS;
+ if (pDevice->GetDeviceCaps().DevType == DeviceType::Vulkan)
+ {
+ CreationAttrs.Desc.Name = "Shader resource layout test FS";
+ CreationAttrs.Desc.ShaderType = SHADER_TYPE_PIXEL;
+ CreationAttrs.SourceLanguage = SHADER_SOURCE_LANGUAGE_GLSL;
+ CreationAttrs.FilePath = "Shaders\\ShaderResLayoutTestGL.psh";
+ pDevice->CreateShader(CreationAttrs, &pPS);
+ VERIFY_EXPR(pPS);
+ }
+
+ PipelineStateDesc PSODesc;
+ PSODesc.Name = "Shader resource layout test";
+ PSODesc.GraphicsPipeline.pVS = pVS;
+ PSODesc.GraphicsPipeline.pPS = pPS;
+ PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ PSODesc.GraphicsPipeline.NumRenderTargets = 1;
+ PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM;
+ PSODesc.GraphicsPipeline.DSVFormat = TEX_FORMAT_D32_FLOAT;
+
+ RefCntAutoPtr<IPipelineState> pTestPSO;
+ pDevice->CreatePipelineState(PSODesc, &pTestPSO);
+ VERIFY_EXPR(pTestPSO);
+
+ SetStatus(TestResult::Succeeded);
+}