Add GL_EXT_fragment_shading_rate
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
spv.builtin.PrimitiveShadingRateEXT.vert
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 26
|
||||
|
||||
Capability Shader
|
||||
Capability FragmentShadingRateKHR
|
||||
Extension "SPV_KHR_fragment_shading_rate"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 8 16
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_fragment_shading_rate"
|
||||
Name 4 "main"
|
||||
Name 8 "id"
|
||||
Name 16 "gl_PrimitiveShadingRateEXT"
|
||||
Decorate 8(id) Location 0
|
||||
Decorate 16(gl_PrimitiveShadingRateEXT) BuiltIn PrimitiveShadingRateKHR
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Input 6(int)
|
||||
8(id): 7(ptr) Variable Input
|
||||
15: TypePointer Output 6(int)
|
||||
16(gl_PrimitiveShadingRateEXT): 15(ptr) Variable Output
|
||||
17: 6(int) Constant 5
|
||||
19: 6(int) Constant 9
|
||||
21: 6(int) Constant 6
|
||||
23: 6(int) Constant 10
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9: 6(int) Load 8(id)
|
||||
SelectionMerge 14 None
|
||||
Switch 9 14
|
||||
case 0: 10
|
||||
case 1: 11
|
||||
case 2: 12
|
||||
case 3: 13
|
||||
10: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 17
|
||||
Branch 14
|
||||
11: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 19
|
||||
Branch 14
|
||||
12: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 21
|
||||
Branch 14
|
||||
13: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 23
|
||||
Branch 14
|
||||
14: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
36
Test/baseResults/spv.builtin.ShadingRateEXT.frag.out
Normal file
36
Test/baseResults/spv.builtin.ShadingRateEXT.frag.out
Normal file
@@ -0,0 +1,36 @@
|
||||
spv.builtin.ShadingRateEXT.frag
|
||||
WARNING: 0:5: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
|
||||
"precision mediump int; precision highp float;"
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 12
|
||||
|
||||
Capability Shader
|
||||
Capability FragmentShadingRateKHR
|
||||
Extension "SPV_KHR_fragment_shading_rate"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 8 10
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_fragment_shading_rate"
|
||||
Name 4 "main"
|
||||
Name 8 "val"
|
||||
Name 10 "gl_ShadingRateEXT"
|
||||
Decorate 8(val) Location 0
|
||||
Decorate 10(gl_ShadingRateEXT) Flat
|
||||
Decorate 10(gl_ShadingRateEXT) BuiltIn ShadingRateKHR
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Output 6(int)
|
||||
8(val): 7(ptr) Variable Output
|
||||
9: TypePointer Input 6(int)
|
||||
10(gl_ShadingRateEXT): 9(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
11: 6(int) Load 10(gl_ShadingRateEXT)
|
||||
Store 8(val) 11
|
||||
Return
|
||||
FunctionEnd
|
||||
28
Test/spv.builtin.PrimitiveShadingRateEXT.vert
Normal file
28
Test/spv.builtin.PrimitiveShadingRateEXT.vert
Normal file
@@ -0,0 +1,28 @@
|
||||
#version 450
|
||||
|
||||
#extension GL_EXT_fragment_shading_rate : enable
|
||||
|
||||
layout(location = 0) in int id;
|
||||
|
||||
void main()
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
// V2 | H2 => 5
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT;
|
||||
break;
|
||||
case 1:
|
||||
// V2 | H4 => 9
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT;
|
||||
break;
|
||||
case 2:
|
||||
// V4 | H2 => 6
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT;
|
||||
break;
|
||||
case 3:
|
||||
// V4 | H4 => 10
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
8
Test/spv.builtin.ShadingRateEXT.frag
Normal file
8
Test/spv.builtin.ShadingRateEXT.frag
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 450
|
||||
|
||||
#extension GL_EXT_fragment_shading_rate : enable
|
||||
|
||||
out highp int val;
|
||||
void main () {
|
||||
val = gl_ShadingRateEXT;
|
||||
}
|
||||
Reference in New Issue
Block a user