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
86e60813
Commit
86e60813
authored
Oct 11, 2015
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate correct image operand mask for Offset and ConstOffset(#77)
parent
820a22fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+4
-1
SpvBuilder.h
SPIRV/SpvBuilder.h
+5
-0
No files found.
SPIRV/SpvBuilder.cpp
View file @
86e60813
...
@@ -1188,7 +1188,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b
...
@@ -1188,7 +1188,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b
xplicit
=
true
;
xplicit
=
true
;
}
}
if
(
parameters
.
offset
)
{
if
(
parameters
.
offset
)
{
mask
=
(
ImageOperandsMask
)(
mask
|
ImageOperandsOffsetMask
);
if
(
isConstant
(
parameters
.
offset
))
mask
=
(
ImageOperandsMask
)(
mask
|
ImageOperandsConstOffsetMask
);
else
mask
=
(
ImageOperandsMask
)(
mask
|
ImageOperandsOffsetMask
);
texArgs
[
numArgs
++
]
=
parameters
.
offset
;
texArgs
[
numArgs
++
]
=
parameters
.
offset
;
}
}
// TBD: if Offset is constant, use ImageOperandsConstOffsetMask
// TBD: if Offset is constant, use ImageOperandsConstOffsetMask
...
...
SPIRV/SpvBuilder.h
View file @
86e60813
...
@@ -136,6 +136,11 @@ public:
...
@@ -136,6 +136,11 @@ public:
bool
isSamplerType
(
Id
typeId
)
const
{
return
getTypeClass
(
typeId
)
==
OpTypeSampler
;
}
bool
isSamplerType
(
Id
typeId
)
const
{
return
getTypeClass
(
typeId
)
==
OpTypeSampler
;
}
bool
isSampledImageType
(
Id
typeId
)
const
{
return
getTypeClass
(
typeId
)
==
OpTypeSampledImage
;
}
bool
isSampledImageType
(
Id
typeId
)
const
{
return
getTypeClass
(
typeId
)
==
OpTypeSampledImage
;
}
bool
isConstant
(
Id
resultId
)
const
{
Op
opCode
=
getOpCode
(
resultId
);
return
opCode
==
OpConstantTrue
||
opCode
==
OpConstantFalse
||
opCode
==
OpConstant
||
opCode
==
OpConstantComposite
||
opCode
==
OpConstantNull
;
}
bool
isConstantScalar
(
Id
resultId
)
const
{
return
getOpCode
(
resultId
)
==
OpConstant
;
}
bool
isConstantScalar
(
Id
resultId
)
const
{
return
getOpCode
(
resultId
)
==
OpConstant
;
}
unsigned
int
getConstantScalar
(
Id
resultId
)
const
{
return
module
.
getInstruction
(
resultId
)
->
getImmediateOperand
(
0
);
}
unsigned
int
getConstantScalar
(
Id
resultId
)
const
{
return
module
.
getInstruction
(
resultId
)
->
getImmediateOperand
(
0
);
}
...
...
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