From 7d27dcd7dc3d6a990a106e95e254009176e7ee53 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 19 Oct 2019 18:54:45 -0700 Subject: Added HLSLVersion, GLSLVersion and GLESSLVersion to ShaderCreateInfo struct (API Version 240035) --- Graphics/GraphicsEngine/interface/APIInfo.h | 2 +- Graphics/GraphicsEngine/interface/Shader.h | 36 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h index 0979a824..36cb5c36 100644 --- a/Graphics/GraphicsEngine/interface/APIInfo.h +++ b/Graphics/GraphicsEngine/interface/APIInfo.h @@ -26,7 +26,7 @@ /// \file /// Diligent API information -#define DILIGENT_API_VERSION 240034 +#define DILIGENT_API_VERSION 240035 #include "../../../Primitives/interface/BasicTypes.h" diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h index d6eca935..257ff4fe 100644 --- a/Graphics/GraphicsEngine/interface/Shader.h +++ b/Graphics/GraphicsEngine/interface/Shader.h @@ -174,6 +174,42 @@ struct ShaderCreateInfo /// Shader source language. See Diligent::SHADER_SOURCE_LANGUAGE. SHADER_SOURCE_LANGUAGE SourceLanguage = SHADER_SOURCE_LANGUAGE_DEFAULT; + + /// Shader version + struct ShaderVersion + { + /// Major revision + Uint8 Major = 0; + + /// Minor revision + Uint8 Minor = 0; + + ShaderVersion()noexcept{} + ShaderVersion(Uint8 _Major, Uint8 _Minor)noexcept : + Major {_Major}, + Minor {_Minor} + {} + }; + + /// HLSL shader model to use when compiling the shader. When default value + /// is given (0, 0), the engine will attempt to use the highest HLSL shader model + /// supported by the device. If the shader is created from the byte code, this value + /// has no effect. + /// + /// \note When HLSL source is converted to GLSL, corresponding GLSL/GLESSL version will be used. + ShaderVersion HLSLVersion = ShaderVersion{}; + + /// GLSL version to use when creating the shader. When default value + /// is given (0, 0), the engine will attempt to use the highest GLSL version + /// supported by the device. + ShaderVersion GLSLVersion = ShaderVersion{}; + + /// GLES shading language version to use when creating the shader. When default value + /// is given (0, 0), the engine will attempt to use the highest GLESSL version + /// supported by the device. + ShaderVersion GLESSLVersion = ShaderVersion{}; + + /// Memory address where pointer to the compiler messages data blob will be written /// The buffer contains two null-terminated strings. The first one is the compiler -- cgit v1.2.3