Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
1ca04c2b
Commit
1ca04c2b
authored
Mar 24, 2017
by
steve-lunarg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: allow length() on scalars
parent
93750bc0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
8 deletions
+123
-8
hlsl.intrinsics.negative.frag.out
Test/baseResults/hlsl.intrinsics.negative.frag.out
+3
-6
hlsl.scalar-length.frag.out
Test/baseResults/hlsl.scalar-length.frag.out
+111
-0
hlsl.scalar-length.frag
Test/hlsl.scalar-length.frag
+6
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslParseables.cpp
hlsl/hlslParseables.cpp
+2
-2
No files found.
Test/baseResults/hlsl.intrinsics.negative.frag.out
View file @
1ca04c2b
hlsl.intrinsics.negative.frag
hlsl.intrinsics.negative.frag
ERROR: 0:10: 'determinant' : no matching overloaded function found
ERROR: 0:10: 'determinant' : no matching overloaded function found
ERROR: 0:23: 'length' : ambiguous best function under implicit type conversion
ERROR: 0:25: 'normalize' : ambiguous best function under implicit type conversion
ERROR: 0:25: 'normalize' : ambiguous best function under implicit type conversion
ERROR: 0:26: 'reflect' : ambiguous best function under implicit type conversion
ERROR: 0:26: 'reflect' : ambiguous best function under implicit type conversion
ERROR: 0:27: 'refract' : ambiguous best function under implicit type conversion
ERROR: 0:27: 'refract' : ambiguous best function under implicit type conversion
...
@@ -59,7 +58,7 @@ ERROR: 0:133: 'normalize' : no matching overloaded function found
...
@@ -59,7 +58,7 @@ ERROR: 0:133: 'normalize' : no matching overloaded function found
ERROR: 0:133: 'reflect' : no matching overloaded function found
ERROR: 0:133: 'reflect' : no matching overloaded function found
ERROR: 0:133: 'refract' : no matching overloaded function found
ERROR: 0:133: 'refract' : no matching overloaded function found
ERROR: 0:133: 'reversebits' : no matching overloaded function found
ERROR: 0:133: 'reversebits' : no matching overloaded function found
ERROR:
60
compilation errors. No code generated.
ERROR:
59
compilation errors. No code generated.
Shader version: 450
Shader version: 450
...
@@ -120,8 +119,7 @@ ERROR: node is still EOpNull!
...
@@ -120,8 +119,7 @@ ERROR: node is still EOpNull!
0:14 Convert float to uint ( temp uint)
0:14 Convert float to uint ( temp uint)
0:14 'inF0' ( in float)
0:14 'inF0' ( in float)
0:23 length ( temp float)
0:23 length ( temp float)
0:23 Construct vec2 ( in 2-component vector of float)
0:23 'inF0' ( in float)
0:23 'inF0' ( in float)
0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint)
0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint)
0:24 Convert float to uint ( temp uint)
0:24 Convert float to uint ( temp uint)
0:24 'inF0' ( in float)
0:24 'inF0' ( in float)
...
@@ -582,8 +580,7 @@ ERROR: node is still EOpNull!
...
@@ -582,8 +580,7 @@ ERROR: node is still EOpNull!
0:14 Convert float to uint ( temp uint)
0:14 Convert float to uint ( temp uint)
0:14 'inF0' ( in float)
0:14 'inF0' ( in float)
0:23 length ( temp float)
0:23 length ( temp float)
0:23 Construct vec2 ( in 2-component vector of float)
0:23 'inF0' ( in float)
0:23 'inF0' ( in float)
0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint)
0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint)
0:24 Convert float to uint ( temp uint)
0:24 Convert float to uint ( temp uint)
0:24 'inF0' ( in float)
0:24 'inF0' ( in float)
...
...
Test/baseResults/hlsl.scalar-length.frag.out
0 → 100644
View file @
1ca04c2b
hlsl.scalar-length.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: @main( ( temp 4-component vector of float)
0:2 Function Parameters:
0:? Sequence
0:3 Sequence
0:3 move second child to first child ( temp 4-component vector of float)
0:3 'test' ( temp 4-component vector of float)
0:3 Constant:
0:3 0.000000
0:3 1.000000
0:3 2.000000
0:3 3.000000
0:5 Branch: Return with expression
0:5 Construct vec4 ( temp 4-component vector of float)
0:5 length ( temp float)
0:5 direct index ( temp float)
0:5 'test' ( temp 4-component vector of float)
0:5 Constant:
0:5 3 (const int)
0:2 Function Definition: main( ( temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:2 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: @main( ( temp 4-component vector of float)
0:2 Function Parameters:
0:? Sequence
0:3 Sequence
0:3 move second child to first child ( temp 4-component vector of float)
0:3 'test' ( temp 4-component vector of float)
0:3 Constant:
0:3 0.000000
0:3 1.000000
0:3 2.000000
0:3 3.000000
0:5 Branch: Return with expression
0:5 Construct vec4 ( temp 4-component vector of float)
0:5 length ( temp float)
0:5 direct index ( temp float)
0:5 'test' ( temp 4-component vector of float)
0:5 Constant:
0:5 3 (const int)
0:2 Function Definition: main( ( temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:2 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 30
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 28
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "@main("
Name 12 "test"
Name 28 "@entryPointOutput"
Decorate 28(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11: TypePointer Function 7(fvec4)
13: 6(float) Constant 0
14: 6(float) Constant 1065353216
15: 6(float) Constant 1073741824
16: 6(float) Constant 1077936128
17: 7(fvec4) ConstantComposite 13 14 15 16
18: TypeInt 32 0
19: 18(int) Constant 3
20: TypePointer Function 6(float)
27: TypePointer Output 7(fvec4)
28(@entryPointOutput): 27(ptr) Variable Output
4(main): 2 Function None 3
5: Label
29: 7(fvec4) FunctionCall 9(@main()
Store 28(@entryPointOutput) 29
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
12(test): 11(ptr) Variable Function
Store 12(test) 17
21: 20(ptr) AccessChain 12(test) 19
22: 6(float) Load 21
23: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 22
24: 7(fvec4) CompositeConstruct 23 23 23 23
ReturnValue 24
FunctionEnd
Test/hlsl.scalar-length.frag
0 → 100644
View file @
1ca04c2b
float4
main
()
:
SV_Target0
{
float4
test
=
{
0
,
1
,
2
,
3
};
return
length
(
test
.
a
);
}
gtests/Hlsl.FromFile.cpp
View file @
1ca04c2b
...
@@ -212,6 +212,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -212,6 +212,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.samplelevel.offset.dx10.frag"
,
"main"
},
{
"hlsl.samplelevel.offset.dx10.frag"
,
"main"
},
{
"hlsl.samplelevel.offsetarray.dx10.frag"
,
"main"
},
{
"hlsl.samplelevel.offsetarray.dx10.frag"
,
"main"
},
{
"hlsl.sample.sub-vec4.dx10.frag"
,
"main"
},
{
"hlsl.sample.sub-vec4.dx10.frag"
,
"main"
},
{
"hlsl.scalar-length.frag"
,
"main"
},
{
"hlsl.semicolons.frag"
,
"main"
},
{
"hlsl.semicolons.frag"
,
"main"
},
{
"hlsl.shapeConv.frag"
,
"main"
},
{
"hlsl.shapeConv.frag"
,
"main"
},
{
"hlsl.shapeConvRet.frag"
,
"main"
},
{
"hlsl.shapeConvRet.frag"
,
"main"
},
...
...
hlsl/hlslParseables.cpp
View file @
1ca04c2b
...
@@ -359,7 +359,7 @@ inline bool IsValid(const char* cname, char retOrder, char retType, char argOrde
...
@@ -359,7 +359,7 @@ inline bool IsValid(const char* cname, char retOrder, char retType, char argOrde
const
std
::
string
name
(
cname
);
const
std
::
string
name
(
cname
);
// these do not have vec1 versions
// these do not have vec1 versions
if
(
dim0
==
1
&&
(
name
==
"
length"
||
name
==
"
normalize"
||
name
==
"reflect"
||
name
==
"refract"
))
if
(
dim0
==
1
&&
(
name
==
"normalize"
||
name
==
"reflect"
||
name
==
"refract"
))
return
false
;
return
false
;
if
(
!
IsTextureType
(
argOrder
)
&&
(
isVec
&&
dim0
==
1
))
// avoid vec1
if
(
!
IsTextureType
(
argOrder
)
&&
(
isVec
&&
dim0
==
1
))
// avoid vec1
...
@@ -625,7 +625,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
...
@@ -625,7 +625,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{
"isinf"
,
nullptr
,
"B"
,
"SVM"
,
"F"
,
EShLangAll
,
false
},
{
"isinf"
,
nullptr
,
"B"
,
"SVM"
,
"F"
,
EShLangAll
,
false
},
{
"isnan"
,
nullptr
,
"B"
,
"SVM"
,
"F"
,
EShLangAll
,
false
},
{
"isnan"
,
nullptr
,
"B"
,
"SVM"
,
"F"
,
EShLangAll
,
false
},
{
"ldexp"
,
nullptr
,
nullptr
,
"SVM,"
,
"F,"
,
EShLangAll
,
false
},
{
"ldexp"
,
nullptr
,
nullptr
,
"SVM,"
,
"F,"
,
EShLangAll
,
false
},
{
"length"
,
"S"
,
"F"
,
"
V"
,
"F"
,
EShLangAll
,
false
},
{
"length"
,
"S"
,
"F"
,
"
SV"
,
"F"
,
EShLangAll
,
false
},
{
"lerp"
,
nullptr
,
nullptr
,
"VM,,"
,
"F,,"
,
EShLangAll
,
false
},
{
"lerp"
,
nullptr
,
nullptr
,
"VM,,"
,
"F,,"
,
EShLangAll
,
false
},
{
"lerp"
,
nullptr
,
nullptr
,
"SVM,,S"
,
"F,,"
,
EShLangAll
,
false
},
{
"lerp"
,
nullptr
,
nullptr
,
"SVM,,S"
,
"F,,"
,
EShLangAll
,
false
},
{
"lit"
,
"V4"
,
"F"
,
"S,,"
,
"F,,"
,
EShLangAll
,
false
},
{
"lit"
,
"V4"
,
"F"
,
"S,,"
,
"F,,"
,
EShLangAll
,
false
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment