From 73292d9f3a1c790f72802dfe4cce57a1353dece6 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 20 Sep 2023 03:30:27 -0700 Subject: Direct SPIRV: Rasterization pipeline tests. (#3216) * Direct SPIRV: Rasterization pipeline tests. * Fixup. * Fix. --------- Co-authored-by: Yong He --- source/slang/core.meta.slang | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'source/slang/core.meta.slang') 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 -- cgit v1.2.3