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
e50b0a85
Commit
e50b0a85
authored
Apr 22, 2021
by
Robin Quint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added usage hint for --auto-sampled-textures, added test cases
parent
25dd807c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
168 additions
and
0 deletions
+168
-0
StandAlone.cpp
StandAlone/StandAlone.cpp
+2
-0
glsl.autosampledtextures.frag.out
Test/baseResults/glsl.autosampledtextures.frag.out
+45
-0
hlsl.autosampledtextures.frag.out
Test/baseResults/hlsl.autosampledtextures.frag.out
+77
-0
glsl.autosampledtextures.frag
Test/glsl.autosampledtextures.frag
+13
-0
hlsl.autosampledtextures.frag
Test/hlsl.autosampledtextures.frag
+22
-0
runtests
Test/runtests
+9
-0
No files found.
StandAlone/StandAlone.cpp
View file @
e50b0a85
...
@@ -1819,6 +1819,8 @@ void usage()
...
@@ -1819,6 +1819,8 @@ void usage()
" without explicit bindings
\n
"
" without explicit bindings
\n
"
" --auto-map-locations | --aml automatically locate input/output lacking
\n
"
" --auto-map-locations | --aml automatically locate input/output lacking
\n
"
" 'location' (fragile, not cross stage)
\n
"
" 'location' (fragile, not cross stage)
\n
"
" --auto-sampled-textures Removes sampler variables and converts
\n
"
" existing textures to combined image-samplers
\n
"
" --client {vulkan<ver>|opengl<ver>} see -V and -G
\n
"
" --client {vulkan<ver>|opengl<ver>} see -V and -G
\n
"
" --depfile <file> writes depfile for build systems
\n
"
" --depfile <file> writes depfile for build systems
\n
"
" --dump-builtin-symbols prints builtin symbol table prior each compile
\n
"
" --dump-builtin-symbols prints builtin symbol table prior each compile
\n
"
...
...
Test/baseResults/glsl.autosampledtextures.frag.out
0 → 100644
View file @
e50b0a85
glsl.autosampledtextures.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 23
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 17 21
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
Name 4 "main"
Name 9 "color"
Name 13 "u_Tex"
Name 17 "in_UV"
Name 21 "out_Color"
Decorate 13(u_Tex) DescriptorSet 0
Decorate 13(u_Tex) Binding 0
Decorate 17(in_UV) Location 0
Decorate 21(out_Color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: TypeImage 6(float) 2D sampled format:Unknown
11: TypeSampledImage 10
12: TypePointer UniformConstant 11
13(u_Tex): 12(ptr) Variable UniformConstant
15: TypeVector 6(float) 2
16: TypePointer Input 15(fvec2)
17(in_UV): 16(ptr) Variable Input
20: TypePointer Output 7(fvec4)
21(out_Color): 20(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(color): 8(ptr) Variable Function
14: 11 Load 13(u_Tex)
18: 15(fvec2) Load 17(in_UV)
19: 7(fvec4) ImageSampleImplicitLod 14 18
Store 9(color) 19
22: 7(fvec4) Load 9(color)
Store 21(out_Color) 22
Return
FunctionEnd
Test/baseResults/hlsl.autosampledtextures.frag.out
0 → 100644
View file @
e50b0a85
hlsl.autosampledtextures.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 45
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "MainPs" 36 40
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "MainPs"
Name 8 "PS_INPUT"
MemberName 8(PS_INPUT) 0 "vTextureCoords"
Name 11 "PS_OUTPUT"
MemberName 11(PS_OUTPUT) 0 "vColor"
Name 14 "@MainPs(struct-PS_INPUT-vf21;"
Name 13 "i"
Name 17 "ps_output"
Name 23 "g_tColor"
Name 34 "i"
Name 36 "i.vTextureCoords"
Name 40 "@entryPointOutput.vColor"
Name 41 "param"
Decorate 23(g_tColor) DescriptorSet 0
Decorate 23(g_tColor) Binding 0
Decorate 36(i.vTextureCoords) Location 0
Decorate 40(@entryPointOutput.vColor) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 2
8(PS_INPUT): TypeStruct 7(fvec2)
9: TypePointer Function 8(PS_INPUT)
10: TypeVector 6(float) 4
11(PS_OUTPUT): TypeStruct 10(fvec4)
12: TypeFunction 11(PS_OUTPUT) 9(ptr)
16: TypePointer Function 11(PS_OUTPUT)
18: TypeInt 32 1
19: 18(int) Constant 0
20: TypeImage 6(float) 2D sampled format:Unknown
21: TypeSampledImage 20
22: TypePointer UniformConstant 21
23(g_tColor): 22(ptr) Variable UniformConstant
25: TypePointer Function 7(fvec2)
29: TypePointer Function 10(fvec4)
35: TypePointer Input 7(fvec2)
36(i.vTextureCoords): 35(ptr) Variable Input
39: TypePointer Output 10(fvec4)
40(@entryPointOutput.vColor): 39(ptr) Variable Output
4(MainPs): 2 Function None 3
5: Label
34(i): 9(ptr) Variable Function
41(param): 9(ptr) Variable Function
37: 7(fvec2) Load 36(i.vTextureCoords)
38: 25(ptr) AccessChain 34(i) 19
Store 38 37
42: 8(PS_INPUT) Load 34(i)
Store 41(param) 42
43:11(PS_OUTPUT) FunctionCall 14(@MainPs(struct-PS_INPUT-vf21;) 41(param)
44: 10(fvec4) CompositeExtract 43 0
Store 40(@entryPointOutput.vColor) 44
Return
FunctionEnd
14(@MainPs(struct-PS_INPUT-vf21;):11(PS_OUTPUT) Function None 12
13(i): 9(ptr) FunctionParameter
15: Label
17(ps_output): 16(ptr) Variable Function
24: 21 Load 23(g_tColor)
26: 25(ptr) AccessChain 13(i) 19
27: 7(fvec2) Load 26
28: 10(fvec4) ImageSampleImplicitLod 24 27
30: 29(ptr) AccessChain 17(ps_output) 19
Store 30 28
31:11(PS_OUTPUT) Load 17(ps_output)
ReturnValue 31
FunctionEnd
Test/glsl.autosampledtextures.frag
0 → 100644
View file @
e50b0a85
#version 460
layout
(
location
=
0
)
in
vec2
in_UV
;
layout
(
set
=
0
,
binding
=
0
)
uniform
texture2D
u_Tex
;
layout
(
set
=
0
,
binding
=
0
)
uniform
sampler
u_Sampler
;
layout
(
location
=
0
)
out
vec4
out_Color
;
void
main
()
{
vec4
color
=
texture
(
sampler2D
(
u_Tex
,
u_Sampler
),
in_UV
);
out_Color
=
color
;
}
Test/hlsl.autosampledtextures.frag
0 → 100644
View file @
e50b0a85
Texture2D
g_tColor
;
SamplerState
g_sAniso
;
struct
PS_INPUT
{
float2
vTextureCoords
:
TEXCOORD2
;
}
;
struct
PS_OUTPUT
{
float4
vColor
:
SV_Target0
;
}
;
PS_OUTPUT
MainPs
(
PS_INPUT
i
)
{
PS_OUTPUT
ps_output
;
ps_output
.
vColor
=
g_tColor
.
Sample
(
g_sAniso
,
i
.
vTextureCoords
.
xy
)
;
return
ps_output
;
}
\ No newline at end of file
Test/runtests
View file @
e50b0a85
...
@@ -281,6 +281,15 @@ run --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.o
...
@@ -281,6 +281,15 @@ run --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.o
diff
-b
$BASEDIR
/spv.400.frag.nanclamp.out
$TARGETDIR
/spv.400.frag.nanclamp.out
||
HASERROR
=
1
diff
-b
$BASEDIR
/spv.400.frag.nanclamp.out
$TARGETDIR
/spv.400.frag.nanclamp.out
||
HASERROR
=
1
#
#
# Test --auto-sampled-textures
#
echo
"Testing auto-sampled-textures"
run
--auto-sampled-textures
-H
-Od
-e
MainPs
-D
-S
frag hlsl.autosampledtextures.frag
>
$TARGETDIR
/hlsl.autosampledtextures.frag.out
diff
-b
$BASEDIR
/hlsl.autosampledtextures.frag.out
$TARGETDIR
/hlsl.autosampledtextures.frag.out
||
HASERROR
=
1
run
--auto-sampled-textures
-H
-Od
-S
frag glsl.autosampledtextures.frag
>
$TARGETDIR
/glsl.autosampledtextures.frag.out
diff
-b
$BASEDIR
/glsl.autosampledtextures.frag.out
$TARGETDIR
/glsl.autosampledtextures.frag.out
||
HASERROR
=
1
#
# Final checking
# Final checking
#
#
if
[
$HASERROR
-eq
0
]
if
[
$HASERROR
-eq
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