From 5af36cf4ca7a81d91fb03cdf39e40b6b4175fa2d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 21 Nov 2023 17:22:41 -0800 Subject: Add SPIRV intrinsics for texture footprint query. (#3345) * Add SPIRV intrinsics for texture footprint query. * Cleanup. --------- Co-authored-by: Yong He --- source/slang/slang-emit-glsl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-emit-glsl.cpp') diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index bbfefc75c..0fc54ca1f 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -2347,6 +2347,18 @@ void GLSLSourceEmitter::emitSimpleTypeImpl(IRType* type) m_writer->emit("hitObjectNV"); return; } + case kIROp_TextureFootprintType: + { + m_glslExtensionTracker->requireExtension(UnownedStringSlice("GL_NV_shader_texture_footprint")); + m_glslExtensionTracker->requireVersion(ProfileVersion::GLSL_450); + + m_writer->emit("gl_TextureFootprint"); + auto intLit = as(type->getOperand(0)); + if (intLit) + m_writer->emit(intLit->getValue()); + m_writer->emit("DNV"); + return; + } default: break; } -- cgit v1.2.3