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
085b8334
Commit
085b8334
authored
Jan 05, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix issue #658: Don't adopt initializer constness from declaration.
This also makes it match how GLSL handles the same thing.
parent
bf9a2f30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
+32
-4
hlsl.init2.frag.out
Test/baseResults/hlsl.init2.frag.out
+0
-0
hlsl.init2.frag
Test/hlsl.init2.frag
+19
-0
revision.h
glslang/Include/revision.h
+2
-2
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+11
-2
No files found.
Test/baseResults/hlsl.init2.frag.out
View file @
085b8334
This diff is collapsed.
Click to expand it.
Test/hlsl.init2.frag
View file @
085b8334
...
...
@@ -18,6 +18,25 @@ void Test1()
struct
mystruct2
{
float
a
;
float
b
;
float
c
;
};
mystruct2
test5
=
{
{
8
,},
{
9
,},
{
10
},
};
const
mystruct2
constTest5
=
{
{
8
,},
{
9
,},
{
10
},
};
constTest5
.
c
;
const
float
step
=
1
.
f
;
float
n
=
0
;
const
float3
a
[
8
]
=
{
normalize
(
float3
(
1
,
1
,
1
))
*
(
n
+=
step
),
normalize
(
float3
(
-
1
,
-
1
,
-
1
))
*
(
n
+=
step
),
normalize
(
float3
(
-
1
,
-
1
,
1
))
*
(
n
+=
step
),
normalize
(
float3
(
-
1
,
1
,
-
1
))
*
(
n
+=
step
),
normalize
(
float3
(
-
1
,
1
,
1
))
*
(
n
+=
step
),
normalize
(
float3
(
1
,
-
1
,
-
1
))
*
(
n
+=
step
),
normalize
(
float3
(
1
,
-
1
,
1
))
*
(
n
+=
step
),
normalize
(
float3
(
1
,
1
,
-
1
))
*
(
n
+=
step
)
};
const
struct
one
{
float3
a
;
}
oneNonConst
=
{
normalize
(
float3
(
-
1
,
1
,
1
))
*
(
n
+=
step
)
};
const
struct
two
{
float3
a
;
float3
b
;
}
twoNonConst
=
{
normalize
(
float3
(
-
1
,
1
,
1
))
*
(
n
+=
step
),
normalize
(
float3
(
-
1
,
1
,
1
))
*
(
n
+=
step
)
};
}
struct
PS_OUTPUT
{
float4
color
:
SV_Target0
;
};
...
...
glslang/Include/revision.h
View file @
085b8334
...
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.173
0
"
#define GLSLANG_DATE "0
3
-Jan-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.173
9
"
#define GLSLANG_DATE "0
5
-Jan-2017"
hlsl/hlslParseHelper.cpp
View file @
085b8334
...
...
@@ -5256,8 +5256,16 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm
// constructor-style subtree, allowing the rest of the code to operate
// identically for both kinds of initializers.
//
//
// Type can't be deduced from the initializer list, so a skeletal type to
// follow has to be passed in. Constness and specialization-constness
// should be deduced bottom up, not dictated by the skeletal type.
//
TType
skeletalType
;
skeletalType
.
shallowCopy
(
variable
->
getType
());
skeletalType
.
getQualifier
().
makeTemporary
();
if
(
initializer
->
getAsAggregate
()
&&
initializer
->
getAsAggregate
()
->
getOp
()
==
EOpNull
)
initializer
=
convertInitializerList
(
loc
,
variable
->
getType
()
,
initializer
);
initializer
=
convertInitializerList
(
loc
,
skeletalType
,
initializer
);
if
(
!
initializer
)
{
// error recovery; don't leave const without constant values
if
(
qualifier
==
EvqConst
)
...
...
@@ -5458,8 +5466,9 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co
emulatedConstructorArguments
=
initList
->
getSequence
()[
0
];
else
emulatedConstructorArguments
=
initList
;
TIntermTyped
*
constructor
=
addConstructor
(
loc
,
emulatedConstructorArguments
,
type
);
return
addConstructor
(
loc
,
emulatedConstructorArguments
,
type
)
;
return
constructor
;
}
// Lengthen list to be long enough to cover any gap from the current list size
...
...
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