Fix and extend essl_to_hlsl to support DX11 HLSL.

TRAC #22330 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1740 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent fb256be9
......@@ -79,6 +79,7 @@ typedef enum {
typedef enum {
SH_ESSL_OUTPUT = 0x8B45,
SH_GLSL_OUTPUT = 0x8B46,
SH_HLSL_OUTPUT = 0x8B47,
SH_HLSL9_OUTPUT = 0x8B47,
SH_HLSL11_OUTPUT = 0x8B48
} ShShaderOutput;
......@@ -229,7 +230,7 @@ typedef void* ShHandle;
// spec: Specifies the language spec the compiler must conform to -
// SH_GLES2_SPEC or SH_WEBGL_SPEC.
// output: Specifies the output code type - SH_ESSL_OUTPUT, SH_GLSL_OUTPUT,
// or SH_HLSL_OUTPUT.
// SH_HLSL9_OUTPUT or SH_HLSL11_OUTPUT.
// resources: Specifies the built-in resources.
COMPILER_EXPORT ShHandle ShConstructCompiler(
ShShaderType type,
......
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -105,7 +105,16 @@ int main(int argc, char* argv[])
switch (argv[0][3]) {
case 'e': output = SH_ESSL_OUTPUT; break;
case 'g': output = SH_GLSL_OUTPUT; break;
case 'h': output = SH_HLSL_OUTPUT; break;
case 'h':
if (argv[0][4] == '1' && argv[0][5] == '1')
{
output = SH_HLSL11_OUTPUT;
}
else
{
output = SH_HLSL9_OUTPUT;
}
break;
default: failCode = EFailUsage;
}
} else {
......@@ -219,7 +228,8 @@ void usage()
" -s=c : use CSS Shaders spec\n"
" -b=e : output GLSL ES code (this is by default)\n"
" -b=g : output GLSL code\n"
" -b=h : output HLSL code\n"
" -b=h9 : output HLSL9 code\n"
" -b=h11 : output HLSL11 code\n"
" -x=i : enable GL_OES_EGL_image_external\n"
" -x=d : enable GL_OES_EGL_standard_derivatives\n"
" -x=r : enable ARB_texture_rectangle\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment