diff options
| author | Yong He <yonghe@outlook.com> | 2023-09-20 03:30:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-20 18:30:27 +0800 |
| commit | 73292d9f3a1c790f72802dfe4cce57a1353dece6 (patch) | |
| tree | b35764fca8962c808b64c2ceed8601e7f4fa1011 /source/slang/core.meta.slang | |
| parent | 739c3a7b53dc6489065fcd5e9f0a04370c5f9c8f (diff) | |
Direct SPIRV: Rasterization pipeline tests. (#3216)
* Direct SPIRV: Rasterization pipeline tests.
* Fixup.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/core.meta.slang')
| -rw-r--r-- | source/slang/core.meta.slang | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index e989e4ffa..55cf5896f 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -1760,16 +1760,42 @@ __target_intrinsic(cpp, "int(((char*)&($1)) - ((char*)&($0))") int __offsetOf(in T t, in F field); /// Mark beginning of "interlocked" operations in a fragment shader. -__target_intrinsic(glsl, "beginInvocationInterlockARB") __glsl_extension(GL_ARB_fragment_shader_interlock) __glsl_version(420) -void beginInvocationInterlock() {} +void beginInvocationInterlock() +{ + __target_switch + { + case glsl: + __intrinsic_asm "beginInvocationInterlockARB"; + case spirv: + spirv_asm { + OpCapability FragmentShaderPixelInterlockEXT; + OpExtension "SPV_EXT_fragment_shader_interlock"; + OpExecutionMode __entryPoint PixelInterlockOrderedEXT; + OpBeginInvocationInterlockEXT; + }; + } +} /// Mark end of "interlocked" operations in a fragment shader. -__target_intrinsic(glsl, "endInvocationInterlockARB") __glsl_extension(GL_ARB_fragment_shader_interlock) __glsl_version(420) -void endInvocationInterlock() {} +void endInvocationInterlock() +{ + __target_switch + { + case glsl: + __intrinsic_asm "endInvocationInterlockARB"; + case spirv: + spirv_asm { + OpCapability FragmentShaderPixelInterlockEXT; + OpExtension "SPV_EXT_fragment_shader_interlock"; + OpExecutionMode __entryPoint PixelInterlockOrderedEXT; + OpEndInvocationInterlockEXT; + }; + } +} // Operators to apply to `enum` types |
