summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-21 17:22:41 -0800
committerGitHub <noreply@github.com>2023-11-21 17:22:41 -0800
commit5af36cf4ca7a81d91fb03cdf39e40b6b4175fa2d (patch)
treed52737e72f83c760724827691c67d0f03b9c71ea /source/slang/slang-emit-glsl.cpp
parent383c0ef172fb19b3b9c7270fb6429ce19fd1b332 (diff)
Add SPIRV intrinsics for texture footprint query. (#3345)
* Add SPIRV intrinsics for texture footprint query. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp12
1 files changed, 12 insertions, 0 deletions
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<IRIntLit>(type->getOperand(0));
+ if (intLit)
+ m_writer->emit(intLit->getValue());
+ m_writer->emit("DNV");
+ return;
+ }
default: break;
}