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
18b9fbd7
Commit
18b9fbd7
authored
Sep 05, 2015
by
Jason Ekstrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPIRV: Add support for texelFetch
There's nothing really special about texelFetch other than the opcode and some restrictions so adding it is pretty trivial.
parent
d6c37b19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+1
-3
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+4
-2
SpvBuilder.h
SPIRV/SpvBuilder.h
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
18b9fbd7
...
@@ -1666,8 +1666,6 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
...
@@ -1666,8 +1666,6 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
// This is no longer a query....
// This is no longer a query....
if
(
cracked
.
fetch
)
spv
::
MissingFunctionality
(
"texel fetch"
);
if
(
cracked
.
gather
)
if
(
cracked
.
gather
)
spv
::
MissingFunctionality
(
"texture gather"
);
spv
::
MissingFunctionality
(
"texture gather"
);
...
@@ -1723,7 +1721,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
...
@@ -1723,7 +1721,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
++
extraArgs
;
++
extraArgs
;
}
}
return
builder
.
createTextureCall
(
precision
,
convertGlslangToSpvType
(
node
->
getType
()),
cracked
.
proj
,
params
);
return
builder
.
createTextureCall
(
precision
,
convertGlslangToSpvType
(
node
->
getType
()),
cracked
.
fetch
,
cracked
.
proj
,
params
);
}
}
spv
::
Id
TGlslangToSpvTraverser
::
handleUserFunctionCall
(
const
glslang
::
TIntermAggregate
*
node
)
spv
::
Id
TGlslangToSpvTraverser
::
handleUserFunctionCall
(
const
glslang
::
TIntermAggregate
*
node
)
...
...
SPIRV/SpvBuilder.cpp
View file @
18b9fbd7
...
@@ -1137,7 +1137,7 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti
...
@@ -1137,7 +1137,7 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti
// Accept all parameters needed to create a texture instruction.
// Accept all parameters needed to create a texture instruction.
// Create the correct instruction based on the inputs, and make the call.
// Create the correct instruction based on the inputs, and make the call.
Id
Builder
::
createTextureCall
(
Decoration
precision
,
Id
resultType
,
bool
proj
,
const
TextureParameters
&
parameters
)
Id
Builder
::
createTextureCall
(
Decoration
precision
,
Id
resultType
,
bool
fetch
,
bool
proj
,
const
TextureParameters
&
parameters
)
{
{
static
const
int
maxTextureArgs
=
10
;
static
const
int
maxTextureArgs
=
10
;
Id
texArgs
[
maxTextureArgs
]
=
{};
Id
texArgs
[
maxTextureArgs
]
=
{};
...
@@ -1196,7 +1196,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, co
...
@@ -1196,7 +1196,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, co
//
//
Op
opCode
;
Op
opCode
;
opCode
=
OpImageSampleImplicitLod
;
opCode
=
OpImageSampleImplicitLod
;
if
(
xplicit
)
{
if
(
fetch
)
{
opCode
=
OpImageFetch
;
}
else
if
(
xplicit
)
{
if
(
parameters
.
Dref
)
{
if
(
parameters
.
Dref
)
{
if
(
proj
)
if
(
proj
)
opCode
=
OpImageSampleProjDrefExplicitLod
;
opCode
=
OpImageSampleProjDrefExplicitLod
;
...
...
SPIRV/SpvBuilder.h
View file @
18b9fbd7
...
@@ -298,7 +298,7 @@ public:
...
@@ -298,7 +298,7 @@ public:
};
};
// Select the correct texture operation based on all inputs, and emit the correct instruction
// Select the correct texture operation based on all inputs, and emit the correct instruction
Id
createTextureCall
(
Decoration
precision
,
Id
resultType
,
bool
proj
,
const
TextureParameters
&
);
Id
createTextureCall
(
Decoration
precision
,
Id
resultType
,
bool
fetch
,
bool
proj
,
const
TextureParameters
&
);
// Emit the OpTextureQuery* instruction that was passed in.
// Emit the OpTextureQuery* instruction that was passed in.
// Figure out the right return value and type, and return it.
// Figure out the right return value and type, and return it.
...
...
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