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
81639827
Commit
81639827
authored
Aug 19, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More preparation for pure built-in functions as enums: Add texturing op cracker.
parent
ef676b0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
6 deletions
+111
-6
intermediate.h
glslang/Include/intermediate.h
+109
-4
revision.h
glslang/Include/revision.h
+2
-2
No files found.
glslang/Include/intermediate.h
View file @
81639827
...
@@ -350,8 +350,7 @@ enum TOperator {
...
@@ -350,8 +350,7 @@ enum TOperator {
// Image operations
// Image operations
//
//
// N.B. The following is not being used yet, pending input, as switching
EOpImageGuardBegin
,
// to it from the current text-based approach will break existing consumers.
EOpImageQuerySize
,
EOpImageQuerySize
,
EOpImageQuerySamples
,
EOpImageQuerySamples
,
...
@@ -366,11 +365,14 @@ enum TOperator {
...
@@ -366,11 +365,14 @@ enum TOperator {
EOpImageAtomicExchange
,
EOpImageAtomicExchange
,
EOpImageAtomicCompSwap
,
EOpImageAtomicCompSwap
,
EOpImageGuardEnd
,
//
//
// Texture operations
// Texture operations
//
//
EOpTextureGuardBegin
,
EOpTextureGuardBegin
,
EOpTextureQuerySize
,
EOpTextureQuerySize
,
EOpTextureQueryLod
,
EOpTextureQueryLod
,
EOpTextureQueryLevels
,
EOpTextureQueryLevels
,
...
@@ -392,6 +394,7 @@ enum TOperator {
...
@@ -392,6 +394,7 @@ enum TOperator {
EOpTextureGather
,
EOpTextureGather
,
EOpTextureGatherOffset
,
EOpTextureGatherOffset
,
EOpTextureGatherOffsets
,
EOpTextureGatherOffsets
,
EOpTextureGuardEnd
,
EOpTextureGuardEnd
,
//
//
...
@@ -605,6 +608,18 @@ protected:
...
@@ -605,6 +608,18 @@ protected:
bool
literal
;
// true if node represents a literal in the source code
bool
literal
;
// true if node represents a literal in the source code
};
};
// Represent the independent aspects of a texturing TOperator
struct
TCrackedTextureOp
{
bool
query
;
bool
proj
;
bool
lod
;
bool
fetch
;
bool
offset
;
bool
offsets
;
bool
gather
;
bool
grad
;
};
//
//
// Intermediate class for node types that hold operators.
// Intermediate class for node types that hold operators.
//
//
...
@@ -613,9 +628,98 @@ public:
...
@@ -613,9 +628,98 @@ public:
virtual
TIntermOperator
*
getAsOperator
()
{
return
this
;
}
virtual
TIntermOperator
*
getAsOperator
()
{
return
this
;
}
virtual
const
TIntermOperator
*
getAsOperator
()
const
{
return
this
;
}
virtual
const
TIntermOperator
*
getAsOperator
()
const
{
return
this
;
}
TOperator
getOp
()
const
{
return
op
;
}
TOperator
getOp
()
const
{
return
op
;
}
virtual
bool
promote
()
{
return
true
;
}
bool
modifiesState
()
const
;
bool
modifiesState
()
const
;
bool
isConstructor
()
const
;
bool
isConstructor
()
const
;
virtual
bool
promote
()
{
return
true
;
}
bool
isTexture
()
const
{
return
op
>
EOpTextureGuardBegin
&&
op
<
EOpTextureGuardEnd
;
}
bool
isImage
()
const
{
return
op
>
EOpImageGuardBegin
&&
op
<
EOpImageGuardEnd
;
}
// Crack the op into the individual dimensions of texturing operation.
void
crackTexture
(
TCrackedTextureOp
&
cracked
)
const
{
cracked
.
query
=
false
;
cracked
.
proj
=
false
;
cracked
.
lod
=
false
;
cracked
.
fetch
=
false
;
cracked
.
offset
=
false
;
cracked
.
offsets
=
false
;
cracked
.
gather
=
false
;
cracked
.
grad
=
false
;
switch
(
op
)
{
case
EOpTextureQuerySize
:
case
EOpTextureQueryLod
:
case
EOpTextureQueryLevels
:
case
EOpTextureQuerySamples
:
cracked
.
query
=
true
;
break
;
case
EOpTexture
:
break
;
case
EOpTextureProj
:
cracked
.
proj
=
true
;
break
;
case
EOpTextureLod
:
cracked
.
lod
=
true
;
break
;
case
EOpTextureOffset
:
cracked
.
offset
=
true
;
break
;
case
EOpTextureFetch
:
cracked
.
fetch
=
true
;
break
;
case
EOpTextureFetchOffset
:
cracked
.
fetch
=
true
;
cracked
.
offset
=
true
;
break
;
case
EOpTextureProjOffset
:
cracked
.
offset
=
true
;
cracked
.
proj
=
true
;
break
;
case
EOpTextureLodOffset
:
cracked
.
offset
=
true
;
cracked
.
lod
=
true
;
break
;
case
EOpTextureProjLod
:
cracked
.
lod
=
true
;
cracked
.
proj
=
true
;
break
;
case
EOpTextureProjLodOffset
:
cracked
.
offset
=
true
;
cracked
.
lod
=
true
;
cracked
.
proj
=
true
;
break
;
case
EOpTextureGrad
:
cracked
.
grad
=
true
;
break
;
case
EOpTextureGradOffset
:
cracked
.
grad
=
true
;
cracked
.
offset
=
true
;
break
;
case
EOpTextureProjGrad
:
cracked
.
grad
=
true
;
cracked
.
proj
=
true
;
break
;
case
EOpTextureProjGradOffset
:
cracked
.
grad
=
true
;
cracked
.
offset
=
true
;
cracked
.
proj
=
true
;
break
;
case
EOpTextureGather
:
cracked
.
gather
=
true
;
break
;
case
EOpTextureGatherOffset
:
cracked
.
gather
=
true
;
cracked
.
offset
=
true
;
break
;
case
EOpTextureGatherOffsets
:
cracked
.
gather
=
true
;
cracked
.
offsets
=
true
;
break
;
default
:
break
;
}
}
protected
:
protected
:
TIntermOperator
(
TOperator
o
)
:
TIntermTyped
(
EbtFloat
),
op
(
o
)
{}
TIntermOperator
(
TOperator
o
)
:
TIntermTyped
(
EbtFloat
),
op
(
o
)
{}
TIntermOperator
(
TOperator
o
,
TType
&
t
)
:
TIntermTyped
(
t
),
op
(
o
)
{}
TIntermOperator
(
TOperator
o
,
TType
&
t
)
:
TIntermTyped
(
t
),
op
(
o
)
{}
...
@@ -651,7 +755,8 @@ public:
...
@@ -651,7 +755,8 @@ public:
TIntermUnary
(
TOperator
o
)
:
TIntermOperator
(
o
),
operand
(
0
)
{}
TIntermUnary
(
TOperator
o
)
:
TIntermOperator
(
o
),
operand
(
0
)
{}
virtual
void
traverse
(
TIntermTraverser
*
);
virtual
void
traverse
(
TIntermTraverser
*
);
virtual
void
setOperand
(
TIntermTyped
*
o
)
{
operand
=
o
;
}
virtual
void
setOperand
(
TIntermTyped
*
o
)
{
operand
=
o
;
}
virtual
TIntermTyped
*
getOperand
()
{
return
operand
;
}
virtual
TIntermTyped
*
getOperand
()
{
return
operand
;
}
virtual
const
TIntermTyped
*
getOperand
()
const
{
return
operand
;
}
virtual
TIntermUnary
*
getAsUnaryNode
()
{
return
this
;
}
virtual
TIntermUnary
*
getAsUnaryNode
()
{
return
this
;
}
virtual
const
TIntermUnary
*
getAsUnaryNode
()
const
{
return
this
;
}
virtual
const
TIntermUnary
*
getAsUnaryNode
()
const
{
return
this
;
}
virtual
bool
promote
();
virtual
bool
promote
();
...
...
glslang/Include/revision.h
View file @
81639827
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// 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).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "2.3.72
5
"
#define GLSLANG_REVISION "2.3.72
6
"
#define GLSLANG_DATE "1
8
-Aug-2015"
#define GLSLANG_DATE "1
9
-Aug-2015"
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