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
fe6689c6
Commit
fe6689c6
authored
Jun 26, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: support point mode.
parent
102328b7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
12 deletions
+58
-12
hlsl.hull.3.tesc.out
Test/baseResults/hlsl.hull.3.tesc.out
+0
-0
hlsl.hull.3.tesc
Test/hlsl.hull.3.tesc
+39
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+18
-12
No files found.
Test/baseResults/hlsl.hull.3.tesc.out
0 → 100755
View file @
fe6689c6
This diff is collapsed.
Click to expand it.
Test/hlsl.hull.3.tesc
0 → 100644
View file @
fe6689c6
// ***
// invocation ID coming from synthesized variable
// ***
struct VS_OUT
{
float3 cpoint : CPOINT;
};
struct HS_CONSTANT_OUT
{
float edges[2] : SV_TessFactor;
};
struct HS_OUT
{
float3 cpoint : CPOINT;
};
[domain("tri")]
[partitioning("integer")]
[outputtopology("point")]
[outputcontrolpoints(4)]
[patchconstantfunc("PCF")]
HS_OUT main(InputPatch<VS_OUT, 4> ip)
{
HS_OUT output;
output.cpoint = ip[0].cpoint;
return output;
}
HS_CONSTANT_OUT PCF(uint pid : SV_PrimitiveId, float4 pos : SV_Position)
{
HS_CONSTANT_OUT output;
output.edges[0] = 2.0f;
output.edges[1] = 8.0f;
return output;
}
gtests/Hlsl.FromFile.cpp
View file @
fe6689c6
...
@@ -143,6 +143,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -143,6 +143,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.function.frag"
,
"main"
},
{
"hlsl.function.frag"
,
"main"
},
{
"hlsl.hull.1.tesc"
,
"main"
},
{
"hlsl.hull.1.tesc"
,
"main"
},
{
"hlsl.hull.2.tesc"
,
"main"
},
{
"hlsl.hull.2.tesc"
,
"main"
},
{
"hlsl.hull.3.tesc"
,
"main"
},
{
"hlsl.hull.void.tesc"
,
"main"
},
{
"hlsl.hull.void.tesc"
,
"main"
},
{
"hlsl.hull.ctrlpt-1.tesc"
,
"main"
},
{
"hlsl.hull.ctrlpt-1.tesc"
,
"main"
},
{
"hlsl.hull.ctrlpt-2.tesc"
,
"main"
},
{
"hlsl.hull.ctrlpt-2.tesc"
,
"main"
},
...
...
hlsl/hlslParseHelper.cpp
View file @
fe6689c6
...
@@ -1833,35 +1833,41 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T
...
@@ -1833,35 +1833,41 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T
}
}
}
}
// Handle [outputtoplogy("...")]
// Handle [outputtop
o
logy("...")]
const
TIntermAggregate
*
topologyAttr
=
attributes
[
EatOutputTopology
];
const
TIntermAggregate
*
topologyAttr
=
attributes
[
EatOutputTopology
];
if
(
topologyAttr
!=
nullptr
)
{
if
(
topologyAttr
!=
nullptr
)
{
const
TConstUnion
&
topoType
=
topologyAttr
->
getSequence
()[
0
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
];
const
TConstUnion
&
topoType
=
topologyAttr
->
getSequence
()[
0
]
->
getAsConstantUnion
()
->
getConstArray
()[
0
];
if
(
topoType
.
getType
()
!=
EbtString
)
{
if
(
topoType
.
getType
()
!=
EbtString
)
{
error
(
loc
,
"invalid outputtoplogy"
,
""
,
""
);
error
(
loc
,
"invalid outputtop
o
logy"
,
""
,
""
);
}
else
{
}
else
{
TString
topologyStr
=
*
topoType
.
getSConst
();
TString
topologyStr
=
*
topoType
.
getSConst
();
std
::
transform
(
topologyStr
.
begin
(),
topologyStr
.
end
(),
topologyStr
.
begin
(),
::
tolower
);
std
::
transform
(
topologyStr
.
begin
(),
topologyStr
.
end
(),
topologyStr
.
begin
(),
::
tolower
);
TVertexOrder
topology
=
EvoNone
;
TVertexOrder
vertexOrder
=
EvoNone
;
TLayoutGeometry
primitive
=
ElgNone
;
if
(
topologyStr
==
"point"
)
{
if
(
topologyStr
==
"point"
)
{
topology
=
EvoNone
;
intermediate
.
setPointMode
()
;
}
else
if
(
topologyStr
==
"line"
)
{
}
else
if
(
topologyStr
==
"line"
)
{
topology
=
EvoNone
;
primitive
=
ElgIsolines
;
}
else
if
(
topologyStr
==
"triangle_cw"
)
{
}
else
if
(
topologyStr
==
"triangle_cw"
)
{
topology
=
EvoCw
;
vertexOrder
=
EvoCw
;
primitive
=
ElgTriangles
;
}
else
if
(
topologyStr
==
"triangle_ccw"
)
{
}
else
if
(
topologyStr
==
"triangle_ccw"
)
{
topology
=
EvoCcw
;
vertexOrder
=
EvoCcw
;
primitive
=
ElgTriangles
;
}
else
{
}
else
{
error
(
loc
,
"unsupported outputtoplogy type"
,
topologyStr
.
c_str
(),
""
);
error
(
loc
,
"unsupported outputtop
o
logy type"
,
topologyStr
.
c_str
(),
""
);
}
}
if
(
topology
!=
EvoNone
)
{
if
(
vertexOrder
!=
EvoNone
)
{
if
(
!
intermediate
.
setVertexOrder
(
topology
))
{
if
(
!
intermediate
.
setVertexOrder
(
vertexOrder
))
{
error
(
loc
,
"cannot change previously set outputtopology"
,
TQualifier
::
getVertexOrderString
(
topology
),
""
);
error
(
loc
,
"cannot change previously set outputtopology"
,
TQualifier
::
getVertexOrderString
(
vertexOrder
),
""
);
}
}
}
}
if
(
primitive
!=
ElgNone
)
intermediate
.
setOutputPrimitive
(
primitive
);
}
}
}
}
...
...
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