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
778806a6
Commit
778806a6
authored
Aug 19, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #1018: Give an error for mismatched return type.
parent
b207daa5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
2 deletions
+2
-2
hlsl.struct.split.assign.frag.out
Test/baseResults/hlsl.struct.split.assign.frag.out
+0
-0
hlsl.struct.split.assign.frag
Test/hlsl.struct.split.assign.frag
+1
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+1
-1
No files found.
Test/baseResults/hlsl.struct.split.assign.frag.out
View file @
778806a6
This diff is collapsed.
Click to expand it.
Test/hlsl.struct.split.assign.frag
View file @
778806a6
...
@@ -8,5 +8,5 @@ float4 main(int i, S input[3]) : COLOR0
...
@@ -8,5 +8,5 @@ float4 main(int i, S input[3]) : COLOR0
S
a
[
3
];
S
a
[
3
];
input
=
a
;
input
=
a
;
return
float3
(
1
.
0
)
;
return
a
[
1
].
pos
;
}
}
hlsl/hlslParseHelper.cpp
View file @
778806a6
...
@@ -2239,7 +2239,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT
...
@@ -2239,7 +2239,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT
value
=
intermediate
.
addConversion
(
EOpReturn
,
*
currentFunctionType
,
value
);
value
=
intermediate
.
addConversion
(
EOpReturn
,
*
currentFunctionType
,
value
);
if
(
value
&&
*
currentFunctionType
!=
value
->
getType
())
if
(
value
&&
*
currentFunctionType
!=
value
->
getType
())
value
=
intermediate
.
addUniShapeConversion
(
EOpReturn
,
*
currentFunctionType
,
value
);
value
=
intermediate
.
addUniShapeConversion
(
EOpReturn
,
*
currentFunctionType
,
value
);
if
(
value
==
nullptr
)
{
if
(
value
==
nullptr
||
*
currentFunctionType
!=
value
->
getType
()
)
{
error
(
loc
,
"type does not match, or is not convertible to, the function's return type"
,
"return"
,
""
);
error
(
loc
,
"type does not match, or is not convertible to, the function's return type"
,
"return"
,
""
);
return
value
;
return
value
;
}
}
...
...
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