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
225e0fca
Commit
225e0fca
authored
Nov 17, 2016
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement the extension GL_AMD_texture_gather_bias_lod
parent
94c18a84
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
384 additions
and
11 deletions
+384
-11
GLSL.ext.AMD.h
SPIRV/GLSL.ext.AMD.h
+7
-1
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+42
-9
doc.cpp
SPIRV/doc.cpp
+4
-0
spv.textureGatherBiasLod.frag.out
Test/baseResults/spv.textureGatherBiasLod.frag.out
+0
-0
spv.textureGatherBiasLod.frag
Test/spv.textureGatherBiasLod.frag
+88
-0
intermediate.h
glslang/Include/intermediate.h
+29
-0
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+129
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+47
-0
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+33
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+2
-1
No files found.
SPIRV/GLSL.ext.AMD.h
View file @
225e0fca
...
...
@@ -28,11 +28,12 @@
#define GLSLextAMD_H
enum
BuiltIn
;
enum
Capability
;
enum
Decoration
;
enum
Op
;
static
const
int
GLSLextAMDVersion
=
100
;
static
const
int
GLSLextAMDRevision
=
2
;
static
const
int
GLSLextAMDRevision
=
3
;
// SPV_AMD_shader_ballot
static
const
char
*
const
E_SPV_AMD_shader_ballot
=
"SPV_AMD_shader_ballot"
;
...
...
@@ -113,4 +114,9 @@ enum GcnShaderAMD {
// SPV_AMD_gpu_shader_half_float
static
const
char
*
const
E_SPV_AMD_gpu_shader_half_float
=
"SPV_AMD_gpu_shader_half_float"
;
// SPV_AMD_texture_gather_bias_lod
static
const
char
*
const
E_SPV_AMD_texture_gather_bias_lod
=
"SPV_AMD_texture_gather_bias_lod"
;
static
const
Capability
OpCapabilityImageGatherBiasLodAMD
=
static_cast
<
Capability
>
(
5009
);
#endif // #ifndef GLSLextAMD_H
SPIRV/GlslangToSpv.cpp
View file @
225e0fca
...
...
@@ -3044,7 +3044,7 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
if
(
i
==
6
)
lvalue
=
true
;
break
;
case
glslang
:
:
EOpSparseTextureGather
:
case
glslang
:
:
EOpSparseTextureGather
:
if
((
sampler
.
shadow
&&
i
==
3
)
||
(
!
sampler
.
shadow
&&
i
==
2
))
lvalue
=
true
;
break
;
...
...
@@ -3053,6 +3053,17 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
if
((
sampler
.
shadow
&&
i
==
4
)
||
(
!
sampler
.
shadow
&&
i
==
3
))
lvalue
=
true
;
break
;
#ifdef AMD_EXTENSIONS
case
glslang
:
:
EOpSparseTextureGatherLod
:
if
(
i
==
3
)
lvalue
=
true
;
break
;
case
glslang
:
:
EOpSparseTextureGatherLodOffset
:
case
glslang
:
:
EOpSparseTextureGatherLodOffsets
:
if
(
i
==
4
)
lvalue
=
true
;
break
;
#endif
default
:
break
;
}
...
...
@@ -3219,10 +3230,22 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
// check for bias argument
bool
bias
=
false
;
#ifdef AMD_EXTENSIONS
if
(
!
cracked
.
lod
&&
!
cracked
.
grad
&&
!
cracked
.
fetch
&&
!
cubeCompare
)
{
#else
if
(
!
cracked
.
lod
&&
!
cracked
.
gather
&&
!
cracked
.
grad
&&
!
cracked
.
fetch
&&
!
cubeCompare
)
{
#endif
int
nonBiasArgCount
=
2
;
#ifdef AMD_EXTENSIONS
if
(
cracked
.
gather
)
++
nonBiasArgCount
;
// comp argument should be present when bias argument is present
#endif
if
(
cracked
.
offset
)
++
nonBiasArgCount
;
#ifdef AMD_EXTENSIONS
else
if
(
cracked
.
offsets
)
++
nonBiasArgCount
;
#endif
if
(
cracked
.
grad
)
nonBiasArgCount
+=
2
;
if
(
cracked
.
lodClamp
)
...
...
@@ -3241,6 +3264,17 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
params
.
sampler
=
builder
.
createUnaryOp
(
spv
::
OpImage
,
builder
.
getImageType
(
params
.
sampler
),
params
.
sampler
);
}
#ifdef AMD_EXTENSIONS
if
(
cracked
.
gather
)
{
const
auto
&
sourceExtensions
=
glslangIntermediate
->
getRequestedExtensions
();
if
(
bias
||
cracked
.
lod
||
sourceExtensions
.
find
(
glslang
::
E_GL_AMD_texture_gather_bias_lod
)
!=
sourceExtensions
.
end
())
{
builder
.
addExtension
(
spv
::
E_SPV_AMD_texture_gather_bias_lod
);
builder
.
addCapability
(
spv
::
OpCapabilityImageGatherBiasLodAMD
);
}
}
#endif
// set the rest of the arguments
params
.
coords
=
arguments
[
1
];
...
...
@@ -3308,21 +3342,20 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
++
extraArgs
;
}
// bias
if
(
bias
)
{
params
.
bias
=
arguments
[
2
+
extraArgs
];
++
extraArgs
;
}
// gather component
if
(
cracked
.
gather
&&
!
sampler
.
shadow
)
{
// default component is 0, if missing, otherwise an argument
if
(
2
+
extraArgs
<
(
int
)
arguments
.
size
())
{
params
.
component
=
arguments
[
2
+
extraArgs
];
++
extraArgs
;
}
else
{
}
else
params
.
component
=
builder
.
makeIntConstant
(
0
);
}
}
// bias
if
(
bias
)
{
params
.
bias
=
arguments
[
2
+
extraArgs
];
++
extraArgs
;
}
// projective component (might not to move)
...
...
SPIRV/doc.cpp
View file @
225e0fca
...
...
@@ -839,6 +839,10 @@ const char* CapabilityString(int info)
case
4437
:
return
"DeviceGroup"
;
case
4439
:
return
"MultiView"
;
#ifdef AMD_EXTENSIONS
case
5009
:
return
"ImageGatherBiasLodAMD"
;
#endif
#ifdef NV_EXTENSIONS
case
5251
:
return
"GeometryShaderPassthroughNV"
;
case
5254
:
return
"ShaderViewportIndexLayerNV"
;
...
...
Test/baseResults/spv.textureGatherBiasLod.frag.out
0 → 100644
View file @
225e0fca
This diff is collapsed.
Click to expand it.
Test/spv.textureGatherBiasLod.frag
0 → 100644
View file @
225e0fca
#version 450 core
#extension GL_ARB_sparse_texture2: enable
#extension GL_AMD_texture_gather_bias_lod: enable
uniform
sampler2D
s2D
;
uniform
sampler2DArray
s2DArray
;
uniform
samplerCube
sCube
;
uniform
samplerCubeArray
sCubeArray
;
in
vec2
c2
;
in
vec3
c3
;
in
vec4
c4
;
in
float
lod
;
in
float
bias
;
out
vec4
fragColor
;
void
main
()
{
vec4
texel
=
vec4
(
0
.
0
);
vec4
result
=
vec4
(
0
.
0
);
const
ivec2
offsets
[
4
]
=
{
ivec2
(
0
,
0
),
ivec2
(
0
,
1
),
ivec2
(
1
,
0
),
ivec2
(
1
,
1
)
};
texel
+=
textureGather
(
s2D
,
c2
,
0
,
bias
);
texel
+=
textureGather
(
s2DArray
,
c3
,
1
,
bias
);
texel
+=
textureGather
(
sCube
,
c3
,
2
,
bias
);
texel
+=
textureGather
(
sCubeArray
,
c4
,
3
,
bias
);
texel
+=
textureGatherOffset
(
s2D
,
c2
,
offsets
[
0
],
0
,
bias
);
texel
+=
textureGatherOffset
(
s2DArray
,
c3
,
offsets
[
1
],
1
,
bias
);
texel
+=
textureGatherOffsets
(
s2D
,
c2
,
offsets
,
0
,
bias
);
texel
+=
textureGatherOffsets
(
s2DArray
,
c3
,
offsets
,
1
,
bias
);
sparseTextureGatherARB
(
s2D
,
c2
,
result
,
0
,
bias
);
texel
+=
result
;
sparseTextureGatherARB
(
s2DArray
,
c3
,
result
,
1
,
bias
);
texel
+=
result
;
sparseTextureGatherARB
(
sCube
,
c3
,
result
,
2
,
bias
);
texel
+=
result
;
sparseTextureGatherARB
(
sCubeArray
,
c4
,
result
,
2
,
bias
);
texel
+=
result
;
sparseTextureGatherOffsetARB
(
s2D
,
c2
,
offsets
[
0
],
result
,
0
,
bias
);
texel
+=
result
;
sparseTextureGatherOffsetARB
(
s2DArray
,
c3
,
offsets
[
1
],
result
,
1
,
bias
);
texel
+=
result
;
sparseTextureGatherOffsetsARB
(
s2D
,
c2
,
offsets
,
result
,
0
,
bias
);
texel
+=
result
;
sparseTextureGatherOffsetsARB
(
s2DArray
,
c3
,
offsets
,
result
,
1
,
bias
);
texel
+=
result
;
texel
+=
textureGatherLodAMD
(
s2D
,
c2
,
lod
);
texel
+=
textureGatherLodAMD
(
s2DArray
,
c3
,
lod
,
1
);
texel
+=
textureGatherLodAMD
(
sCube
,
c3
,
lod
,
2
);
texel
+=
textureGatherLodAMD
(
sCubeArray
,
c4
,
lod
,
3
);
texel
+=
textureGatherLodOffsetAMD
(
s2D
,
c2
,
lod
,
offsets
[
0
]);
texel
+=
textureGatherLodOffsetAMD
(
s2DArray
,
c3
,
lod
,
offsets
[
1
],
1
);
texel
+=
textureGatherLodOffsetsAMD
(
s2D
,
c2
,
lod
,
offsets
);
texel
+=
textureGatherLodOffsetsAMD
(
s2DArray
,
c3
,
lod
,
offsets
,
1
);
sparseTextureGatherLodAMD
(
s2D
,
c2
,
lod
,
result
);
texel
+=
result
;
sparseTextureGatherLodAMD
(
s2DArray
,
c3
,
lod
,
result
,
1
);
texel
+=
result
;
sparseTextureGatherLodAMD
(
sCube
,
c3
,
lod
,
result
,
2
);
texel
+=
result
;
sparseTextureGatherLodAMD
(
sCubeArray
,
c4
,
lod
,
result
,
2
);
texel
+=
result
;
sparseTextureGatherLodOffsetAMD
(
s2D
,
c2
,
lod
,
offsets
[
0
],
result
);
texel
+=
result
;
sparseTextureGatherLodOffsetAMD
(
s2DArray
,
c3
,
lod
,
offsets
[
1
],
result
,
1
);
texel
+=
result
;
sparseTextureGatherLodOffsetsAMD
(
s2D
,
c2
,
lod
,
offsets
,
result
);
texel
+=
result
;
sparseTextureGatherLodOffsetsAMD
(
s2DArray
,
c3
,
lod
,
offsets
,
result
,
1
);
texel
+=
result
;
fragColor
=
texel
;
}
glslang/Include/intermediate.h
View file @
225e0fca
...
...
@@ -567,6 +567,11 @@ enum TOperator {
EOpTextureOffsetClamp
,
EOpTextureGradClamp
,
EOpTextureGradOffsetClamp
,
#ifdef AMD_EXTENSIONS
EOpTextureGatherLod
,
EOpTextureGatherLodOffset
,
EOpTextureGatherLodOffsets
,
#endif
EOpSparseTextureGuardBegin
,
...
...
@@ -586,6 +591,11 @@ enum TOperator {
EOpSparseTextureOffsetClamp
,
EOpSparseTextureGradClamp
,
EOpSparseTextureGradOffsetClamp
,
#ifdef AMD_EXTENSIONS
EOpSparseTextureGatherLod
,
EOpSparseTextureGatherLodOffset
,
EOpSparseTextureGatherLodOffsets
,
#endif
EOpSparseTextureGuardEnd
,
EOpSamplingGuardEnd
,
...
...
@@ -1075,6 +1085,25 @@ public:
cracked
.
gather
=
true
;
cracked
.
offsets
=
true
;
break
;
#ifdef AMD_EXTENSIONS
case
EOpTextureGatherLod
:
case
EOpSparseTextureGatherLod
:
cracked
.
gather
=
true
;
cracked
.
lod
=
true
;
break
;
case
EOpTextureGatherLodOffset
:
case
EOpSparseTextureGatherLodOffset
:
cracked
.
gather
=
true
;
cracked
.
offset
=
true
;
cracked
.
lod
=
true
;
break
;
case
EOpTextureGatherLodOffsets
:
case
EOpSparseTextureGatherLodOffsets
:
cracked
.
gather
=
true
;
cracked
.
offsets
=
true
;
cracked
.
lod
=
true
;
break
;
#endif
case
EOpSubpassLoad
:
case
EOpSubpassLoadMS
:
cracked
.
subpass
=
true
;
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
225e0fca
...
...
@@ -3844,6 +3844,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
else
{
addSamplingFunctions
(
sampler
,
typeName
,
version
,
profile
);
addGatherFunctions
(
sampler
,
typeName
,
version
,
profile
);
if
(
spvVersion
.
vulkan
>
0
&&
sampler
.
dim
==
EsdBuffer
&&
sampler
.
isCombined
())
{
// Vulkan wants a textureBuffer to allow texelFetch() --
// a sampled image with no sampler.
...
...
@@ -4349,6 +4350,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
default
:
break
;
}
if
(
sparse
)
s
.
append
(
"ARB"
);
s
.
append
(
"("
);
...
...
@@ -4388,6 +4390,116 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
}
}
}
#ifdef AMD_EXTENSIONS
if
(
sampler
.
dim
==
EsdRect
||
sampler
.
shadow
)
return
;
if
(
profile
==
EEsProfile
||
version
<
450
)
return
;
for
(
int
bias
=
0
;
bias
<
2
;
++
bias
)
{
// loop over presence of bias argument
for
(
int
lod
=
0
;
lod
<
2
;
++
lod
)
{
// loop over presence of lod argument
if
((
lod
&&
bias
)
||
(
lod
==
0
&&
bias
==
0
))
continue
;
for
(
int
offset
=
0
;
offset
<
3
;
++
offset
)
{
// loop over three forms of offset in the call name: none, Offset, and Offsets
for
(
int
comp
=
0
;
comp
<
2
;
++
comp
)
{
// loop over presence of comp argument
if
(
comp
==
0
&&
bias
)
continue
;
if
(
offset
>
0
&&
sampler
.
dim
==
EsdCube
)
continue
;
for
(
int
sparse
=
0
;
sparse
<=
1
;
++
sparse
)
{
// loop over "bool" sparse or not
if
(
sparse
&&
(
profile
==
EEsProfile
||
version
<
450
))
continue
;
TString
s
;
// return type
if
(
sparse
)
s
.
append
(
"int "
);
else
{
s
.
append
(
prefixes
[
sampler
.
type
]);
s
.
append
(
"vec4 "
);
}
// name
if
(
sparse
)
s
.
append
(
"sparseTextureGather"
);
else
s
.
append
(
"textureGather"
);
if
(
lod
)
s
.
append
(
"Lod"
);
switch
(
offset
)
{
case
1
:
s
.
append
(
"Offset"
);
break
;
case
2
:
s
.
append
(
"Offsets"
);
default
:
break
;
}
if
(
lod
)
s
.
append
(
"AMD"
);
else
if
(
sparse
)
s
.
append
(
"ARB"
);
s
.
append
(
"("
);
// sampler type argument
s
.
append
(
typeName
);
// P coordinate argument
s
.
append
(
",vec"
);
int
totalDims
=
dimMap
[
sampler
.
dim
]
+
(
sampler
.
arrayed
?
1
:
0
);
s
.
append
(
postfixes
[
totalDims
]);
// lod argument
if
(
lod
)
s
.
append
(
",float"
);
// offset argument
if
(
offset
>
0
)
{
s
.
append
(
",ivec2"
);
if
(
offset
==
2
)
s
.
append
(
"[4]"
);
}
// texel out (for sparse texture)
if
(
sparse
)
{
s
.
append
(
",out "
);
s
.
append
(
prefixes
[
sampler
.
type
]);
s
.
append
(
"vec4 "
);
}
// comp argument
if
(
comp
)
s
.
append
(
",int"
);
// bias argument
if
(
bias
)
s
.
append
(
",float"
);
s
.
append
(
");
\n
"
);
if
(
bias
)
stageBuiltins
[
EShLangFragment
].
append
(
s
);
else
commonBuiltins
.
append
(
s
);
}
}
}
}
}
#endif
}
//
...
...
@@ -5366,6 +5478,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable
(
"gl_BaryCoordSmoothSampleAMD"
,
EbvBaryCoordSmoothSample
,
symbolTable
);
BuiltInVariable
(
"gl_BaryCoordPullModelAMD"
,
EbvBaryCoordPullModel
,
symbolTable
);
}
// E_GL_AMD_texture_gather_bias_lod
if
(
profile
!=
EEsProfile
)
{
symbolTable
.
setFunctionExtensions
(
"textureGatherLodAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
symbolTable
.
setFunctionExtensions
(
"textureGatherLodOffsetAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
symbolTable
.
setFunctionExtensions
(
"textureGatherLodOffsetsAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
symbolTable
.
setFunctionExtensions
(
"sparseTextureGatherLodAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
symbolTable
.
setFunctionExtensions
(
"sparseTextureGatherLodOffsetAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
symbolTable
.
setFunctionExtensions
(
"sparseTextureGatherLodOffsetsAMD"
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
);
}
#endif
symbolTable
.
setVariableExtensions
(
"gl_FragDepthEXT"
,
1
,
&
E_GL_EXT_frag_depth
);
...
...
@@ -5752,6 +5874,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable
.
relateToOperator
(
"cubeFaceIndexAMD"
,
EOpCubeFaceIndex
);
symbolTable
.
relateToOperator
(
"cubeFaceCoordAMD"
,
EOpCubeFaceCoord
);
symbolTable
.
relateToOperator
(
"timeAMD"
,
EOpTime
);
symbolTable
.
relateToOperator
(
"textureGatherLodAMD"
,
EOpTextureGatherLod
);
symbolTable
.
relateToOperator
(
"textureGatherLodOffsetAMD"
,
EOpTextureGatherLodOffset
);
symbolTable
.
relateToOperator
(
"textureGatherLodOffsetsAMD"
,
EOpTextureGatherLodOffsets
);
symbolTable
.
relateToOperator
(
"sparseTextureGatherLodAMD"
,
EOpSparseTextureGatherLod
);
symbolTable
.
relateToOperator
(
"sparseTextureGatherLodOffsetAMD"
,
EOpSparseTextureGatherLodOffset
);
symbolTable
.
relateToOperator
(
"sparseTextureGatherLodOffsetsAMD"
,
EOpSparseTextureGatherLodOffsets
);
#endif
}
}
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
225e0fca
...
...
@@ -1442,9 +1442,56 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
error
(
loc
,
"must be a compile-time constant:"
,
feature
,
"component argument"
);
}
#ifdef AMD_EXTENSIONS
bool
bias
=
false
;
if
(
callNode
.
getOp
()
==
EOpTextureGather
)
bias
=
fnCandidate
.
getParamCount
()
>
3
;
else
if
(
callNode
.
getOp
()
==
EOpTextureGatherOffset
||
callNode
.
getOp
()
==
EOpTextureGatherOffsets
)
bias
=
fnCandidate
.
getParamCount
()
>
4
;
if
(
bias
)
{
featureString
=
fnCandidate
.
getName
()
+
"with bias argument"
;
feature
=
featureString
.
c_str
();
profileRequires
(
loc
,
~
EEsProfile
,
450
,
nullptr
,
feature
);
requireExtensions
(
loc
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
,
feature
);
}
#endif
break
;
}
#ifdef AMD_EXTENSIONS
case
EOpSparseTextureGather
:
case
EOpSparseTextureGatherOffset
:
case
EOpSparseTextureGatherOffsets
:
{
bool
bias
=
false
;
if
(
callNode
.
getOp
()
==
EOpSparseTextureGather
)
bias
=
fnCandidate
.
getParamCount
()
>
4
;
else
if
(
callNode
.
getOp
()
==
EOpSparseTextureGatherOffset
||
callNode
.
getOp
()
==
EOpSparseTextureGatherOffsets
)
bias
=
fnCandidate
.
getParamCount
()
>
5
;
if
(
bias
)
{
TString
featureString
=
fnCandidate
.
getName
()
+
"with bias argument"
;
const
char
*
feature
=
featureString
.
c_str
();
profileRequires
(
loc
,
~
EEsProfile
,
450
,
nullptr
,
feature
);
requireExtensions
(
loc
,
1
,
&
E_GL_AMD_texture_gather_bias_lod
,
feature
);
}
break
;
}
case
EOpSparseTextureGatherLod
:
case
EOpSparseTextureGatherLodOffset
:
case
EOpSparseTextureGatherLodOffsets
:
{
requireExtensions
(
loc
,
1
,
&
E_GL_ARB_sparse_texture2
,
fnCandidate
.
getName
().
c_str
());
break
;
}
#endif
case
EOpTextureOffset
:
case
EOpTextureFetchOffset
:
case
EOpTextureProjOffset
:
...
...
glslang/MachineIndependent/Versions.cpp
View file @
225e0fca
...
...
@@ -194,6 +194,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_AMD_shader_explicit_vertex_parameter
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_gcn_shader
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_gpu_shader_half_float
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_texture_gather_bias_lod
]
=
EBhDisable
;
#endif
#ifdef NV_EXTENSIONS
...
...
@@ -316,6 +317,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_AMD_shader_explicit_vertex_parameter 1
\n
"
"#define GL_AMD_gcn_shader 1
\n
"
"#define GL_AMD_gpu_shader_half_float 1
\n
"
"#define GL_AMD_texture_gather_bias_lod 1
\n
"
#endif
#ifdef NV_EXTENSIONS
...
...
glslang/MachineIndependent/Versions.h
View file @
225e0fca
...
...
@@ -146,6 +146,7 @@ const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader
const
char
*
const
E_GL_AMD_shader_explicit_vertex_parameter
=
"GL_AMD_shader_explicit_vertex_parameter"
;
const
char
*
const
E_GL_AMD_gcn_shader
=
"GL_AMD_gcn_shader"
;
const
char
*
const
E_GL_AMD_gpu_shader_half_float
=
"GL_AMD_gpu_shader_half_float"
;
const
char
*
const
E_GL_AMD_texture_gather_bias_lod
=
"GL_AMD_texture_gather_bias_lod"
;
#endif
#ifdef NV_EXTENSIONS
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
225e0fca
...
...
@@ -390,6 +390,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case
EOpRcp
:
out
.
debug
<<
"rcp"
;
break
;
case
EOpSaturate
:
out
.
debug
<<
"saturate"
;
break
;
case
EOpSparseTexelsResident
:
out
.
debug
<<
"sparseTexelsResident"
;
break
;
#ifdef AMD_EXTENSIONS
case
EOpMinInvocations
:
out
.
debug
<<
"minInvocations"
;
break
;
case
EOpMaxInvocations
:
out
.
debug
<<
"maxInvocations"
;
break
;
...
...
@@ -647,6 +649,37 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case
EOpTextureGather
:
out
.
debug
<<
"textureGather"
;
break
;
case
EOpTextureGatherOffset
:
out
.
debug
<<
"textureGatherOffset"
;
break
;
case
EOpTextureGatherOffsets
:
out
.
debug
<<
"textureGatherOffsets"
;
break
;
case
EOpTextureClamp
:
out
.
debug
<<
"textureClamp"
;
break
;
case
EOpTextureOffsetClamp
:
out
.
debug
<<
"textureOffsetClamp"
;
break
;
case
EOpTextureGradClamp
:
out
.
debug
<<
"textureGradClamp"
;
break
;
case
EOpTextureGradOffsetClamp
:
out
.
debug
<<
"textureGradOffsetClamp"
;
break
;
#ifdef AMD_EXTENSIONS
case
EOpTextureGatherLod
:
out
.
debug
<<
"textureGatherLod"
;
break
;
case
EOpTextureGatherLodOffset
:
out
.
debug
<<
"textureGatherLodOffset"
;
break
;
case
EOpTextureGatherLodOffsets
:
out
.
debug
<<
"textureGatherLodOffsets"
;
break
;
#endif
case
EOpSparseTexture
:
out
.
debug
<<
"sparseTexture"
;
break
;
case
EOpSparseTextureOffset
:
out
.
debug
<<
"sparseTextureOffset"
;
break
;
case
EOpSparseTextureLod
:
out
.
debug
<<
"sparseTextureLod"
;
break
;
case
EOpSparseTextureLodOffset
:
out
.
debug
<<
"sparseTextureLodOffset"
;
break
;
case
EOpSparseTextureFetch
:
out
.
debug
<<
"sparseTexelFetch"
;
break
;
case
EOpSparseTextureFetchOffset
:
out
.
debug
<<
"sparseTexelFetchOffset"
;
break
;
case
EOpSparseTextureGrad
:
out
.
debug
<<
"sparseTextureGrad"
;
break
;
case
EOpSparseTextureGradOffset
:
out
.
debug
<<
"sparseTextureGradOffset"
;
break
;
case
EOpSparseTextureGather
:
out
.
debug
<<
"sparseTextureGather"
;
break
;
case
EOpSparseTextureGatherOffset
:
out
.
debug
<<
"sparseTextureGatherOffset"
;
break
;
case
EOpSparseTextureGatherOffsets
:
out
.
debug
<<
"sparseTextureGatherOffsets"
;
break
;
case
EOpSparseImageLoad
:
out
.
debug
<<
"sparseImageLoad"
;
break
;
case
EOpSparseTextureClamp
:
out
.
debug
<<
"sparseTextureClamp"
;
break
;
case
EOpSparseTextureOffsetClamp
:
out
.
debug
<<
"sparseTextureOffsetClamp"
;
break
;
case
EOpSparseTextureGradClamp
:
out
.
debug
<<
"sparseTextureGradClamp"
;
break
;
case
EOpSparseTextureGradOffsetClamp
:
out
.
debug
<<
"sparseTextureGradOffsetClam"
;
break
;
#ifdef AMD_EXTENSIONS
case
EOpSparseTextureGatherLod
:
out
.
debug
<<
"sparseTextureGatherLod"
;
break
;
case
EOpSparseTextureGatherLodOffset
:
out
.
debug
<<
"sparseTextureGatherLodOffset"
;
break
;
case
EOpSparseTextureGatherLodOffsets
:
out
.
debug
<<
"sparseTextureGatherLodOffsets"
;
break
;
#endif
case
EOpAddCarry
:
out
.
debug
<<
"addCarry"
;
break
;
case
EOpSubBorrow
:
out
.
debug
<<
"subBorrow"
;
break
;
...
...
gtests/Spv.FromFile.cpp
View file @
225e0fca
...
...
@@ -396,7 +396,8 @@ INSTANTIATE_TEST_CASE_P(
Glsl
,
CompileVulkanToSpirvTestAMD
,
::
testing
::
ValuesIn
(
std
::
vector
<
std
::
string
>
({
"spv.float16.frag"
,
"spv.shaderBallotAMD.comp"
"spv.shaderBallotAMD.comp"
,
"spv.textureGatherBiasLod.frag"
})),
FileNameAsCustomTestSuffix
);
...
...
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