Pure Texture to Sampled Texture Transform
Adds a transformation step to the post processing step. Two modes are available: 1) keep - Keeps samplers, textures and sampled textures as is 2) transform pure texture into sampled texture and remove pure samplers - removes all pure samplers - transforms all pure textures into its sampled counter part Change-Id: If54972e8052961db66c23f4b7e719d363cf6edbd
This commit is contained in:
parent
d6af18f621
commit
baf570efa5
9 changed files with 159 additions and 2 deletions
38
Test/baseResults/spv.texture.sampler.transform.frag.out
Normal file
38
Test/baseResults/spv.texture.sampler.transform.frag.out
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
spv.texture.sampler.transform.frag
|
||||
Warning, version 440 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 19
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 9 16
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 440
|
||||
Name 4 "main"
|
||||
Name 9 "color"
|
||||
Name 12 "tex"
|
||||
Name 16 "coord"
|
||||
Decorate 12(tex) DescriptorSet 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Output 7(fvec4)
|
||||
9(color): 8(ptr) Variable Output
|
||||
10: TypeImage 6(float) 2D sampled format:Unknown
|
||||
11: TypePointer UniformConstant 10
|
||||
12(tex): 11(ptr) Variable UniformConstant
|
||||
14: TypeVector 6(float) 2
|
||||
15: TypePointer Input 14(fvec2)
|
||||
16(coord): 15(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
13: 10 Load 12(tex)
|
||||
17: 14(fvec2) Load 16(coord)
|
||||
18: 7(fvec4) ImageSampleImplicitLod 13 17
|
||||
Store 9(color) 18
|
||||
Return
|
||||
FunctionEnd
|
||||
13
Test/spv.texture.sampler.transform.frag
Normal file
13
Test/spv.texture.sampler.transform.frag
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#version 440
|
||||
|
||||
uniform sampler smp;
|
||||
uniform texture2D tex;
|
||||
|
||||
in vec2 coord;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(sampler2D(tex, smp), coord);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue