HLSL: Plumb in HLSL parse context and keywords, and most basic HLSL parser and test.
This commit is contained in:
parent
b3dc3acd59
commit
e01a9bc8c0
16 changed files with 5047 additions and 16 deletions
21
Test/baseResults/hlsl.frag.out
Normal file
21
Test/baseResults/hlsl.frag.out
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
hlsl.frag
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 6
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Name 4 "PixelShaderFunction"
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
4(PixelShaderFunction): 2 Function None 3
|
||||
5: Label
|
||||
FunctionEnd
|
||||
11
Test/hlsl.frag
Normal file
11
Test/hlsl.frag
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//float4x4 World;
|
||||
//float4x4 View;
|
||||
//float4x4 Projection;
|
||||
//
|
||||
//float4 AmbientColor = float4(1, 1, 1, 1);
|
||||
//float AmbientIntensity = 0.1;
|
||||
//
|
||||
//float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
//{
|
||||
// return AmbientColor * AmbientIntensity;
|
||||
//}
|
||||
|
|
@ -55,6 +55,24 @@ while read t; do
|
|||
done < test-spirv-list
|
||||
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
||||
|
||||
#
|
||||
# HLSL -> SPIR-V code generation tests
|
||||
#
|
||||
while read t; do
|
||||
case $t in
|
||||
\#*)
|
||||
# Skip comment lines in the test list file.
|
||||
;;
|
||||
*)
|
||||
echo Running HLSL-to-SPIR-V $t...
|
||||
b=`basename $t`
|
||||
$EXE -D -e PixelShaderFunction -H $t > $TARGETDIR/$b.out
|
||||
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
||||
;;
|
||||
esac
|
||||
done < test-hlsl-spirv-list
|
||||
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
||||
|
||||
#
|
||||
# Preprocessor tests
|
||||
#
|
||||
|
|
|
|||
4
Test/test-hlsl-spirv-list
Normal file
4
Test/test-hlsl-spirv-list
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Test looping constructs.
|
||||
# No tests yet for making sure break and continue from a nested loop
|
||||
# goes to the innermost target.
|
||||
hlsl.frag
|
||||
Loading…
Add table
Add a link
Reference in a new issue