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
7afe1344
Commit
7afe1344
authored
Mar 18, 2017
by
steve-lunarg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: strip off array dimension when assign locations of arrayed IO.
parent
194f0f39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
hlsl.basic.geom.out
Test/baseResults/hlsl.basic.geom.out
+5
-5
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+24
-5
No files found.
Test/baseResults/hlsl.basic.geom.out
View file @
7afe1344
...
...
@@ -60,14 +60,14 @@ output primitive = line_strip
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:16 move second child to first child ( temp 3-element array of uint)
0:? 'test' ( temp 3-element array of uint)
0:? 'test' (layout( location=
3
) in 3-element array of uint)
0:? 'test' (layout( location=
1
) in 3-element array of uint)
0:16 Function Call: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void)
0:? 'VertexID' ( temp 3-element array of uint)
0:? 'test' ( temp 3-element array of uint)
0:? 'OutputStream' ( temp structure{ temp float myfloat, temp int something})
0:? Linker Objects
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:? 'test' (layout( location=
3
) in 3-element array of uint)
0:? 'test' (layout( location=
1
) in 3-element array of uint)
Linked geometry stage:
...
...
@@ -134,14 +134,14 @@ output primitive = line_strip
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:16 move second child to first child ( temp 3-element array of uint)
0:? 'test' ( temp 3-element array of uint)
0:? 'test' (layout( location=
3
) in 3-element array of uint)
0:? 'test' (layout( location=
1
) in 3-element array of uint)
0:16 Function Call: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void)
0:? 'VertexID' ( temp 3-element array of uint)
0:? 'test' ( temp 3-element array of uint)
0:? 'OutputStream' ( temp structure{ temp float myfloat, temp int something})
0:? Linker Objects
0:? 'VertexID' (layout( location=0) in 3-element array of uint)
0:? 'test' (layout( location=
3
) in 3-element array of uint)
0:? 'test' (layout( location=
1
) in 3-element array of uint)
// Module Version 10000
// Generated by (magic number): 80001
...
...
@@ -173,7 +173,7 @@ output primitive = line_strip
Name 53 "param"
Name 55 "param"
Decorate 45(VertexID) Location 0
Decorate 48(test) Location
3
Decorate 48(test) Location
1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
...
...
hlsl/hlslParseHelper.cpp
View file @
7afe1344
...
...
@@ -1419,15 +1419,24 @@ void HlslParseContext::fixBuiltInArrayType(TType& type)
void
HlslParseContext
::
assignLocations
(
TVariable
&
variable
)
{
const
auto
assignLocation
=
[
&
](
TVariable
&
variable
)
{
const
TQualifier
&
qualifier
=
variable
.
getType
().
getQualifier
();
const
TType
&
type
=
variable
.
getType
();
const
TQualifier
&
qualifier
=
type
.
getQualifier
();
if
(
qualifier
.
storage
==
EvqVaryingIn
||
qualifier
.
storage
==
EvqVaryingOut
)
{
if
(
qualifier
.
builtIn
==
EbvNone
)
{
// Strip off the outer array dimension for those having an extra one.
int
size
;
if
(
type
.
isArray
()
&&
qualifier
.
isArrayedIo
(
language
))
{
TType
elementType
(
type
,
0
);
size
=
intermediate
.
computeTypeLocationSize
(
elementType
);
}
else
size
=
intermediate
.
computeTypeLocationSize
(
type
);
if
(
qualifier
.
storage
==
EvqVaryingIn
)
{
variable
.
getWritableType
().
getQualifier
().
layoutLocation
=
nextInLocation
;
nextInLocation
+=
intermediate
.
computeTypeLocationSize
(
variable
.
getType
())
;
nextInLocation
+=
size
;
}
else
{
variable
.
getWritableType
().
getQualifier
().
layoutLocation
=
nextOutLocation
;
nextOutLocation
+=
intermediate
.
computeTypeLocationSize
(
variable
.
getType
())
;
nextOutLocation
+=
size
;
}
}
...
...
@@ -1892,10 +1901,14 @@ void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& return
ioVariable
->
getWritableType
().
setStruct
(
newLists
->
second
.
output
);
}
}
if
(
storage
==
EvqVaryingIn
)
if
(
storage
==
EvqVaryingIn
)
{
correctInput
(
ioVariable
->
getWritableType
().
getQualifier
());
else
if
(
language
==
EShLangTessEvaluation
)
if
(
!
ioVariable
->
getType
().
isArray
())
ioVariable
->
getWritableType
().
getQualifier
().
patch
=
true
;
}
else
{
correctOutput
(
ioVariable
->
getWritableType
().
getQualifier
());
}
ioVariable
->
getWritableType
().
getQualifier
().
storage
=
storage
;
return
ioVariable
;
};
...
...
@@ -4212,6 +4225,10 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBu
case
EbvStencilRef
:
error
(
loc
,
"unimplemented; need ARB_shader_stencil_export"
,
"SV_STENCILREF"
,
""
);
break
;
case
EbvTessLevelInner
:
case
EbvTessLevelOuter
:
qualifier
.
patch
=
true
;
break
;
default
:
break
;
}
...
...
@@ -7254,6 +7271,8 @@ bool HlslParseContext::isInputBuiltIn(const TQualifier& qualifier) const
case
EbvTessLevelInner
:
case
EbvTessLevelOuter
:
return
language
==
EShLangTessEvaluation
;
case
EbvTessCoord
:
return
language
==
EShLangTessEvaluation
;
default
:
return
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