Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
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
angle
Commits
680553bf
Commit
680553bf
authored
Mar 08, 2010
by
daniel@transgaming.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler - implement faceforward
TRAC #11365 Signed-off-by: Daniel Koch git-svn-id:
https://angleproject.googlecode.com/svn/trunk@4
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
2884b78a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
Initialize.cpp
Compiler/Initialize.cpp
+1
-1
OutputHLSL.cpp
Compiler/OutputHLSL.cpp
+51
-1
No files found.
Compiler/Initialize.cpp
View file @
680553bf
...
...
@@ -556,7 +556,7 @@ void IdentifyBuiltIns(EShLanguage language, TSymbolTable& symbolTable)
symbolTable
.
relateToOperator
(
"dot"
,
EOpDot
);
symbolTable
.
relateToOperator
(
"cross"
,
EOpCross
);
symbolTable
.
relateToOperator
(
"normalize"
,
EOpNormalize
);
symbolTable
.
relateToOperator
(
"f
orward"
,
EOpFaceForward
);
symbolTable
.
relateToOperator
(
"f
aceforward"
,
EOpFaceForward
);
symbolTable
.
relateToOperator
(
"reflect"
,
EOpReflect
);
symbolTable
.
relateToOperator
(
"refract"
,
EOpRefract
);
...
...
Compiler/OutputHLSL.cpp
View file @
680553bf
...
...
@@ -296,18 +296,68 @@ void OutputHLSL::header()
"{
\n
"
" return x - y * floor(x / y);
\n
"
"}
\n
"
"
\n
"
"float2 mod(float2 x, float y)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" return x - y * floor(x / y);
\n
"
"}
\n
"
"
\n
"
"float3 mod(float3 x, float y)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" return x - y * floor(x / y);
\n
"
"}
\n
"
"
\n
"
"float4 mod(float4 x, float y)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" return x - y * floor(x / y);
\n
"
"}
\n
"
"
\n
"
"float faceforward(float N, float I, float Nref)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" if(dot(Nref, I) < 0)
\n
"
" {
\n
"
" return N;
\n
"
" }
\n
"
" else
\n
"
" {
\n
"
" return -N;
\n
"
" }
\n
"
"}
\n
"
"
\n
"
"float2 faceforward(float2 N, float2 I, float2 Nref)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" if(dot(Nref, I) < 0)
\n
"
" {
\n
"
" return N;
\n
"
" }
\n
"
" else
\n
"
" {
\n
"
" return -N;
\n
"
" }
\n
"
"}
\n
"
"
\n
"
"float3 faceforward(float3 N, float3 I, float3 Nref)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" if(dot(Nref, I) < 0)
\n
"
" {
\n
"
" return N;
\n
"
" }
\n
"
" else
\n
"
" {
\n
"
" return -N;
\n
"
" }
\n
"
"}
\n
"
"float4 faceforward(float4 N, float4 I, float4 Nref)
\n
"
// FIXME: Prevent name clashes
"{
\n
"
" if(dot(Nref, I) < 0)
\n
"
" {
\n
"
" return N;
\n
"
" }
\n
"
" else
\n
"
" {
\n
"
" return -N;
\n
"
" }
\n
"
"}
\n
"
"
\n
"
;
}
...
...
@@ -818,7 +868,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
case
EOpDistance
:
outputTriplet
(
visit
,
"distance("
,
", "
,
")"
);
break
;
case
EOpDot
:
outputTriplet
(
visit
,
"dot("
,
", "
,
")"
);
break
;
case
EOpCross
:
outputTriplet
(
visit
,
"cross("
,
", "
,
")"
);
break
;
case
EOpFaceForward
:
UNIMPLEMENTED
();
/* FIXME */
out
<<
"face-forward"
;
break
;
case
EOpFaceForward
:
outputTriplet
(
visit
,
"faceforward("
,
", "
,
")"
);
break
;
case
EOpReflect
:
outputTriplet
(
visit
,
"reflect("
,
", "
,
")"
);
break
;
case
EOpRefract
:
outputTriplet
(
visit
,
"refract("
,
", "
,
")"
);
break
;
case
EOpMul
:
outputTriplet
(
visit
,
"("
,
" * "
,
")"
);
break
;
...
...
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