diff options
Diffstat (limited to 'source/slang/emit.cpp')
| -rw-r--r-- | source/slang/emit.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 1e833838c..381b3c7c8 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -115,8 +115,6 @@ struct SharedEmitContext ModuleDecl* program; - bool needHackSamplerForTexelFetch = false; - ExtensionUsageTracker extensionUsageTracker; UInt uniqueIDCounter = 1; @@ -3052,36 +3050,6 @@ struct EmitVisitor } break; - case 'P': - { - // Okay, we need a collosal hack to deal with the fact that GLSL `texelFetch()` - // for Vulkan seems to be completely broken by design. It's signature wants - // a `sampler2D` for consistency with its peers, but the actual SPIR-V operation - // ignores the sampler paart of it, and just used the `texture2D` part. - // - // The HLSL equivalent (e.g., `Texture2D.Load()`) doesn't provide a sampler - // argument, so we seemingly need to conjure one out of thin air. :( - // - // We are going to hack this *hard* for now. - - auto textureArg = args[0].get(); - if (auto baseTextureType = as<IRTextureType>(textureArg->getDataType())) - { - emitGLSLTextureOrTextureSamplerType(baseTextureType, "sampler"); - Emit("("); - emitIROperand(ctx, textureArg, mode); - Emit(","); - Emit("SLANG_hack_samplerForTexelFetch"); - context->shared->needHackSamplerForTexelFetch = true; - Emit(")"); - } - else - { - SLANG_UNEXPECTED("bad format in intrinsic definition"); - } - } - break; - case 'z': { // If we are calling a D3D texturing operation in the form t.Foo(s, ...), @@ -6204,14 +6172,6 @@ String emitEntryPoint( finalResultBuilder << sharedContext.extensionUsageTracker.glslExtensionRequireLines.ProduceString(); - if (sharedContext.needHackSamplerForTexelFetch) - { - finalResultBuilder - << "layout(set = 0, binding = " - << programLayout->bindingForHackSampler - << ") uniform sampler SLANG_hack_samplerForTexelFetch;\n"; - } - finalResultBuilder << code; String finalResult = finalResultBuilder.ProduceString(); |
