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
79f8bf0d
Commit
79f8bf0d
authored
Mar 09, 2017
by
John Kessenich
Committed by
GitHub
Mar 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #760 from steve-lunarg/gathercmpred
HLSL: Enable GatherCmpRed. Green/Blue/Alpha cannot be supported.
parents
88e88e59
d00b0261
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
68 deletions
+74
-68
hlsl.gathercmpRGBA.offset.dx10.frag.out
Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
+0
-0
hlsl.gathercmpRGBA.offset.dx10.frag
Test/hlsl.gathercmpRGBA.offset.dx10.frag
+68
-65
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+5
-3
No files found.
Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
0 → 100644
View file @
79f8bf0d
This diff is collapsed.
Click to expand it.
Test/hlsl.gathercmpRGBA.offset.dx10.frag
View file @
79f8bf0d
...
...
@@ -29,10 +29,10 @@ uniform float2 c2;
uniform
float3
c3
;
uniform
float4
c4
;
uniform
int
o1
;
uniform
int2
o2
;
uniform
int3
o3
;
uniform
int4
o4
;
PS_OUTPUT
main
()
{
...
...
@@ -42,69 +42,72 @@ PS_OUTPUT main()
// no 1D gathers
float4
txval001
=
g_tTex2df4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
int4
txval011
=
g_tTex2di4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
uint4
txval021
=
g_tTex2du4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
float4
txval001
=
g_tTex2df4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
0
)
);
int4
txval011
=
g_tTex2di4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
-
1
)
);
uint4
txval021
=
g_tTex2du4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
1
)
);
float4
txval004
=
g_tTex2df4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
int4
txval014
=
g_tTex2di4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
uint4
txval024
=
g_tTex2du4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
float4
txval004
=
g_tTex2df4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
0
),
int2
(
1
,
0
),
int2
(
1
,
0
),
int2
(
1
,
0
)
);
int4
txval014
=
g_tTex2di4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
-
1
),
int2
(
1
,
-
1
),
int2
(
1
,
-
1
),
int2
(
1
,
-
1
)
);
uint4
txval024
=
g_tTex2du4
.
GatherCmpRed
(
g_sSampCmp
,
c2
,
0
.
75
,
int2
(
1
,
1
),
int2
(
1
,
1
),
int2
(
1
,
1
),
int2
(
1
,
1
)
);
// float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
float4
txval101
=
g_tTex2df4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
int4
txval111
=
g_tTex2di4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
uint4
txval121
=
g_tTex2du4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
float4
txval104
=
g_tTex2df4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
int4
txval114
=
g_tTex2di4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
uint4
txval124
=
g_tTex2du4
.
GatherCmpGreen
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
// float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
float4
txval201
=
g_tTex2df4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
int4
txval211
=
g_tTex2di4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
uint4
txval221
=
g_tTex2du4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
float4
txval204
=
g_tTex2df4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
int4
txval214
=
g_tTex2di4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
uint4
txval224
=
g_tTex2du4
.
GatherCmpBlue
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
// float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
float4
txval301
=
g_tTex2df4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
int4
txval311
=
g_tTex2di4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
uint4
txval321
=
g_tTex2du4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
);
float4
txval304
=
g_tTex2df4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
int4
txval314
=
g_tTex2di4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
uint4
txval324
=
g_tTex2du4
.
GatherCmpAlpha
(
g_sSampCmp
,
c2
,
0
.
75
,
o2
,
o2
,
o2
,
o2
);
// float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// int4 txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// uint4 txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
// float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// int4 txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// uint4 txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
// float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
// float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// GatherCmpGreen not implemented pending OpImageDrefGather component input
// float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
// float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// GatherCmpBlue not implemented pending OpImageDrefGather component input
// float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
// float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
// GatherCmpAlpha not implemented pending OpImageDrefGather component input
// float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
// int4 txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
// uint4 txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
// float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// int4 txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// uint4 txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
// float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// int4 txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// uint4 txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
// float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// int4 txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// uint4 txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
// no 3D gathers with offset
...
...
gtests/Hlsl.FromFile.cpp
View file @
79f8bf0d
...
...
@@ -111,6 +111,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.gather.basic.dx10.vert"
,
"main"
},
{
"hlsl.gather.offset.dx10.frag"
,
"main"
},
{
"hlsl.gather.offsetarray.dx10.frag"
,
"main"
},
{
"hlsl.gathercmpRGBA.offset.dx10.frag"
,
"main"
},
{
"hlsl.gatherRGBA.array.dx10.frag"
,
"main"
},
{
"hlsl.gatherRGBA.basic.dx10.frag"
,
"main"
},
{
"hlsl.gatherRGBA.offset.dx10.frag"
,
"main"
},
...
...
hlsl/hlslParseHelper.cpp
View file @
79f8bf0d
...
...
@@ -3043,8 +3043,10 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
// For now, we have nothing to map the component-wise comparison forms
// to, because neither GLSL nor SPIR-V has such an opcode. Issue an
// unimplemented error instead. Most of the machinery is here if that
// should ever become available.
if
(
cmpValues
)
{
// should ever become available. However, red can be passed through
// to OpImageDrefGather. G/B/A cannot, because that opcode does not
// accept a component.
if
(
cmpValues
!=
0
&&
op
!=
EOpMethodGatherCmpRed
)
{
error
(
loc
,
"unimplemented: component-level gather compare"
,
""
,
""
);
return
;
}
...
...
@@ -3125,7 +3127,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
}
// Add comparison value if we have one
if
(
arg
Tex
->
getType
().
getSampler
().
isShadow
()
)
if
(
arg
Cmp
!=
nullptr
)
txgather
->
getSequence
().
push_back
(
argCmp
);
// Add offset (either 1, or an array of 4) if we have one
...
...
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