summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src/TestTexturing.cpp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-05-29 01:09:48 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-05-29 01:09:48 +0000
commitcd27f5affb46c349987902aa31014500d5fbef79 (patch)
tree79c39c72242c9d08a250dd35412b036f4485224a /Tests/TestApp/src/TestTexturing.cpp
parentUpdated shader resource layout test (diff)
downloadDiligentEngine-cd27f5affb46c349987902aa31014500d5fbef79.tar.gz
DiligentEngine-cd27f5affb46c349987902aa31014500d5fbef79.zip
Updated multiple tests
Diffstat (limited to 'Tests/TestApp/src/TestTexturing.cpp')
-rw-r--r--Tests/TestApp/src/TestTexturing.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Tests/TestApp/src/TestTexturing.cpp b/Tests/TestApp/src/TestTexturing.cpp
index bcc6c30..9a9b356 100644
--- a/Tests/TestApp/src/TestTexturing.cpp
+++ b/Tests/TestApp/src/TestTexturing.cpp
@@ -132,11 +132,13 @@ void TestTexturing::GenerateTextureData(IRenderDevice *pRenderDevice, std::vecto
}
-void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, TEXTURE_FORMAT TexFormat, bool bUseOpenGL, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent )
+void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, TEXTURE_FORMAT TexFormat, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent )
{
m_pRenderDevice = pDevice;
m_TextureFormat = TexFormat;
m_pDeviceContext = pDeviceContext;
+ auto DevType = m_pRenderDevice->GetDeviceCaps().DevType;
+ bool bUseGLSL = DevType == DeviceType::OpenGL || DevType == DeviceType::OpenGLES || DevType == DeviceType::Vulkan;
float Vertices[] =
{
@@ -167,11 +169,11 @@ void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext
ShaderCreationAttribs CreationAttrs;
BasicShaderSourceStreamFactory BasicSSSFactory;
CreationAttrs.pShaderSourceStreamFactory = &BasicSSSFactory;
- CreationAttrs.Desc.TargetProfile = bUseOpenGL ? SHADER_PROFILE_GL_4_2 : SHADER_PROFILE_DX_5_0;
+ CreationAttrs.Desc.TargetProfile = bUseGLSL ? SHADER_PROFILE_GL_4_2 : SHADER_PROFILE_DX_5_0;
RefCntAutoPtr<Diligent::IShader> pVS, pPS;
{
- CreationAttrs.FilePath = bUseOpenGL ? "Shaders\\TextureTestGL.vsh" : "Shaders\\TextureTestDX.vsh";
+ CreationAttrs.FilePath = bUseGLSL ? "Shaders\\TextureTestGL.vsh" : "Shaders\\TextureTestDX.vsh";
CreationAttrs.Desc.ShaderType = SHADER_TYPE_VERTEX;
m_pRenderDevice->CreateShader( CreationAttrs, &pVS );
}
@@ -180,9 +182,9 @@ void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext
PixelFormatAttribs.ComponentType == COMPONENT_TYPE_SINT;
{
if( bIsIntTexture )
- CreationAttrs.FilePath = bUseOpenGL ? "Shaders\\TextureIntTestGL.psh" : "Shaders\\TextureIntTestDX.psh";
+ CreationAttrs.FilePath = bUseGLSL ? "Shaders\\TextureIntTestGL.psh" : "Shaders\\TextureIntTestDX.psh";
else
- CreationAttrs.FilePath = bUseOpenGL ? "Shaders\\TextureTestGL.psh" : "Shaders\\TextureTestDX.psh";
+ CreationAttrs.FilePath = bUseGLSL ? "Shaders\\TextureTestGL.psh" : "Shaders\\TextureTestDX.psh";
CreationAttrs.Desc.ShaderType = SHADER_TYPE_PIXEL;
StaticSamplerDesc StaticSampler;