summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------external/glslang0
-rw-r--r--source/core/core.vcxproj2
-rw-r--r--source/core/core.vcxproj.filters26
-rw-r--r--source/slang-glslang/slang-glslang.cpp3
-rw-r--r--source/slang-glslang/slang-glslang.vcxproj3
-rw-r--r--source/slang-glslang/slang-glslang.vcxproj.filters9
-rw-r--r--source/slang/core.meta.slang22
-rw-r--r--source/slang/core.meta.slang.h22
-rw-r--r--source/slang/emit.cpp40
-rw-r--r--source/slang/hlsl.meta.slang6
-rw-r--r--source/slang/hlsl.meta.slang.h6
-rw-r--r--source/slang/parameter-binding.cpp79
-rw-r--r--source/slang/slang.vcxproj2
-rw-r--r--source/slang/slang.vcxproj.filters2
-rw-r--r--source/slang/type-layout.h5
-rw-r--r--tests/bindings/glsl-parameter-blocks.slang.glsl6
-rw-r--r--tests/reflection/binding-gl.hlsl.expected7
-rw-r--r--tests/reflection/binding-push-constant-gl.hlsl.expected7
-rw-r--r--tests/reflection/cross-compile.slang.expected7
-rw-r--r--tests/reflection/parameter-block.slang.expected7
-rw-r--r--tools/slang-test/slang-test.vcxproj2
-rw-r--r--tools/slang-test/slang-test.vcxproj.filters2
22 files changed, 71 insertions, 194 deletions
diff --git a/external/glslang b/external/glslang
-Subproject 5a867acad5da07cfb59a1eaadf8e366fb58bbed
+Subproject 088da33263b320c3713b39d5f1928e503f07e67
diff --git a/source/core/core.vcxproj b/source/core/core.vcxproj
index 2944ee9dd..8ec4b7031 100644
--- a/source/core/core.vcxproj
+++ b/source/core/core.vcxproj
@@ -213,4 +213,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project> \ No newline at end of file
diff --git a/source/core/core.vcxproj.filters b/source/core/core.vcxproj.filters
index 9e90aaa77..f30cad939 100644
--- a/source/core/core.vcxproj.filters
+++ b/source/core/core.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
@@ -54,6 +54,12 @@
<ClInclude Include="slang-math.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="slang-memory-arena.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="slang-random-generator.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="slang-string-util.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -75,12 +81,6 @@
<ClInclude Include="type-traits.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="slang-memory-arena.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="slang-random-generator.h">
- <Filter>Header Files</Filter>
- </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="platform.cpp">
@@ -92,6 +92,12 @@
<ClCompile Include="slang-io.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="slang-memory-arena.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="slang-random-generator.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="slang-string-util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -107,12 +113,6 @@
<ClCompile Include="token-reader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="slang-memory-arena.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="slang-random-generator.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="core.natvis">
diff --git a/source/slang-glslang/slang-glslang.cpp b/source/slang-glslang/slang-glslang.cpp
index ae61823d1..2f5f17e42 100644
--- a/source/slang-glslang/slang-glslang.cpp
+++ b/source/slang-glslang/slang-glslang.cpp
@@ -46,7 +46,8 @@ static TBuiltInResource gResources =
UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED,
UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED,
UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED,
- UNLIMITED, UNLIMITED, UNLIMITED,
+ UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED, UNLIMITED,
+ UNLIMITED, UNLIMITED,
{ true, true, true, true, true, true, true, true, true, }
};
diff --git a/source/slang-glslang/slang-glslang.vcxproj b/source/slang-glslang/slang-glslang.vcxproj
index d1975cba5..28e64e8de 100644
--- a/source/slang-glslang/slang-glslang.vcxproj
+++ b/source/slang-glslang/slang-glslang.vcxproj
@@ -176,6 +176,7 @@
<ClInclude Include="..\..\external\glslang\SPIRV\Logger.h" />
<ClInclude Include="..\..\external\glslang\SPIRV\SPVRemapper.h" />
<ClInclude Include="..\..\external\glslang\SPIRV\SpvBuilder.h" />
+ <ClInclude Include="..\..\external\glslang\SPIRV\SpvTools.h" />
<ClInclude Include="..\..\external\glslang\SPIRV\bitutils.h" />
<ClInclude Include="..\..\external\glslang\SPIRV\disassemble.h" />
<ClInclude Include="..\..\external\glslang\SPIRV\doc.h" />
@@ -213,6 +214,8 @@
<ClCompile Include="..\..\external\glslang\SPIRV\Logger.cpp" />
<ClCompile Include="..\..\external\glslang\SPIRV\SPVRemapper.cpp" />
<ClCompile Include="..\..\external\glslang\SPIRV\SpvBuilder.cpp" />
+ <ClCompile Include="..\..\external\glslang\SPIRV\SpvPostProcess.cpp" />
+ <ClCompile Include="..\..\external\glslang\SPIRV\SpvTools.cpp" />
<ClCompile Include="..\..\external\glslang\SPIRV\disassemble.cpp" />
<ClCompile Include="..\..\external\glslang\SPIRV\doc.cpp" />
<ClCompile Include="..\..\external\glslang\StandAlone\ResourceLimits.cpp" />
diff --git a/source/slang-glslang/slang-glslang.vcxproj.filters b/source/slang-glslang/slang-glslang.vcxproj.filters
index 0d3841020..2e15ff5bd 100644
--- a/source/slang-glslang/slang-glslang.vcxproj.filters
+++ b/source/slang-glslang/slang-glslang.vcxproj.filters
@@ -39,6 +39,9 @@
<ClInclude Include="..\..\external\glslang\SPIRV\SpvBuilder.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\external\glslang\SPIRV\SpvTools.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\..\external\glslang\SPIRV\bitutils.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -146,6 +149,12 @@
<ClCompile Include="..\..\external\glslang\SPIRV\SpvBuilder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\external\glslang\SPIRV\SpvPostProcess.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\external\glslang\SPIRV\SpvTools.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\..\external\glslang\SPIRV\disassemble.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang
index b5b78c2e5..fd8826de3 100644
--- a/source/slang/core.meta.slang
+++ b/source/slang/core.meta.slang
@@ -544,6 +544,7 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
{
{
sb << "__glsl_version(450)\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
sb << "__target_intrinsic(glsl, \"(";
int aa = 1;
@@ -556,7 +557,7 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
lodStr.append(")");
}
- String opStr = " = textureSize($P" + lodStr;
+ String opStr = " = textureSize($0" + lodStr;
switch( access )
{
case SLANG_RESOURCE_ACCESS_READ_WRITE:
@@ -603,12 +604,12 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if(isMultisample)
{
- sb << ", ($" << aa++ << " = textureSamples($P))";
+ sb << ", ($" << aa++ << " = textureSamples($0))";
}
if (includeMipInfo)
{
- sb << ", ($" << aa++ << " = textureQueryLevels($P))";
+ sb << ", ($" << aa++ << " = textureQueryLevels($0))";
}
@@ -680,11 +681,13 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if (isMultisample)
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, $1, $3)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, $1, $3)\")\n";
}
else
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ")\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ")\")\n";
}
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
@@ -696,11 +699,13 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if (isMultisample)
{
- sb << "__target_intrinsic(glsl, \"texelFetchOffset($P, $0, $1, $2)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetchOffset($0, $0, $1, $2)\")\n";
}
else
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ", $2)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ", $2)\")\n";
}
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
@@ -741,7 +746,8 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
{
case SLANG_RESOURCE_ACCESS_NONE:
case SLANG_RESOURCE_ACCESS_READ:
- sb << "__target_intrinsic(glsl, \"texelFetch($P, " << ivecN << "($1)";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, " << ivecN << "($1)";
if( !isMultisample )
{
sb << ", 0";
diff --git a/source/slang/core.meta.slang.h b/source/slang/core.meta.slang.h
index c69878112..d5b513d2f 100644
--- a/source/slang/core.meta.slang.h
+++ b/source/slang/core.meta.slang.h
@@ -559,6 +559,7 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
{
{
sb << "__glsl_version(450)\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
sb << "__target_intrinsic(glsl, \"(";
int aa = 1;
@@ -571,7 +572,7 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
lodStr.append(")");
}
- String opStr = " = textureSize($P" + lodStr;
+ String opStr = " = textureSize($0" + lodStr;
switch( access )
{
case SLANG_RESOURCE_ACCESS_READ_WRITE:
@@ -618,12 +619,12 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if(isMultisample)
{
- sb << ", ($" << aa++ << " = textureSamples($P))";
+ sb << ", ($" << aa++ << " = textureSamples($0))";
}
if (includeMipInfo)
{
- sb << ", ($" << aa++ << " = textureQueryLevels($P))";
+ sb << ", ($" << aa++ << " = textureQueryLevels($0))";
}
@@ -695,11 +696,13 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if (isMultisample)
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, $1, $3)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, $1, $3)\")\n";
}
else
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ")\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ")\")\n";
}
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
@@ -711,11 +714,13 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
if (isMultisample)
{
- sb << "__target_intrinsic(glsl, \"texelFetchOffset($P, $0, $1, $2)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetchOffset($0, $0, $1, $2)\")\n";
}
else
{
- sb << "__target_intrinsic(glsl, \"texelFetch($P, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ", $2)\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, ($1)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($1)." << kGLSLLoadLODSwizzle[loadCoordCount] << ", $2)\")\n";
}
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
@@ -756,7 +761,8 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
{
case SLANG_RESOURCE_ACCESS_NONE:
case SLANG_RESOURCE_ACCESS_READ:
- sb << "__target_intrinsic(glsl, \"texelFetch($P, " << ivecN << "($1)";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, " << ivecN << "($1)";
if( !isMultisample )
{
sb << ", 0";
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();
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index bf6c12788..b8cd7a4ad 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -1187,14 +1187,16 @@ for (int aa = 0; aa < kBaseBufferAccessLevelCount; ++aa)
sb << "void GetDimensions(out uint dim);\n";
- sb << "__target_intrinsic(glsl, \"texelFetch($P, $1)$z\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, $1)$z\")\n";
sb << "T Load(int location);\n";
sb << "T Load(int location, out uint status);\n";
sb << "__subscript(uint index) -> T {\n";
- sb << "__target_intrinsic(glsl, \"texelFetch($P, int($1))$z\") get;\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, int($1))$z\") get;\n";
if (kBaseBufferAccessLevels[aa].access != SLANG_RESOURCE_ACCESS_READ)
{
diff --git a/source/slang/hlsl.meta.slang.h b/source/slang/hlsl.meta.slang.h
index 8a7add3aa..7a2bcc759 100644
--- a/source/slang/hlsl.meta.slang.h
+++ b/source/slang/hlsl.meta.slang.h
@@ -1232,14 +1232,16 @@ for (int aa = 0; aa < kBaseBufferAccessLevelCount; ++aa)
sb << "void GetDimensions(out uint dim);\n";
- sb << "__target_intrinsic(glsl, \"texelFetch($P, $1)$z\")\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, $1)$z\")\n";
sb << "T Load(int location);\n";
sb << "T Load(int location, out uint status);\n";
sb << "__subscript(uint index) -> T {\n";
- sb << "__target_intrinsic(glsl, \"texelFetch($P, int($1))$z\") get;\n";
+ sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
+ sb << "__target_intrinsic(glsl, \"texelFetch($0, int($1))$z\") get;\n";
if (kBaseBufferAccessLevels[aa].access != SLANG_RESOURCE_ACCESS_READ)
{
diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp
index 40491c4df..34b490c71 100644
--- a/source/slang/parameter-binding.cpp
+++ b/source/slang/parameter-binding.cpp
@@ -2231,44 +2231,6 @@ static void collectParameters(
}
}
-static bool isGLSLCrossCompilerNeeded(
- TargetRequest* targetReq)
-{
- auto compileReq = targetReq->compileRequest;
-
- // We only need cross-compilation if we
- // are targetting something GLSL-based.
- switch (targetReq->target)
- {
- default:
- return false;
-
- case CodeGenTarget::GLSL:
- case CodeGenTarget::SPIRV:
- case CodeGenTarget::SPIRVAssembly:
- break;
- }
-
- // If we `import`ed any Slang code, then the
- // cross compiler is definitely needed, to
- // translate that Slang over to GLSL.
- if (compileReq->loadedModulesList.Count() != 0)
- return true;
-
- // If there are any non-GLSL translation units,
- // then we need to cross compile those...
- for (auto tu : compileReq->translationUnits)
- {
- if (tu->sourceLanguage != SourceLanguage::GLSL)
- return true;
- }
-
- // If we get to this point, then we have plain vanilla
- // GLSL input, with no `import` declarations, so we
- // are able to output GLSL without cross compilation.
- return false;
-}
-
void generateParameterBindings(
TargetRequest* targetReq)
{
@@ -2356,12 +2318,6 @@ void generateParameterBindings(
}
}
}
- // If we are having to insert our "hack" default sampler, then
- // we need to put it in the default space.
- if (isGLSLCrossCompilerNeeded(targetReq))
- {
- needDefaultSpace = true;
- }
// If we need a space for default bindings, then allocate it here.
if (needDefaultSpace)
@@ -2504,39 +2460,6 @@ void generateParameterBindings(
globalScopeLayout = globalConstantBufferLayout;
}
- // Final final step: pick a binding for the "hack sampler", if needed...
- //
- // We only want to do this if the GLSL cross-compilation support is
- // being invoked, so that we don't gum up other shaders.
- if(isGLSLCrossCompilerNeeded(targetReq))
- {
- UInt space = sharedContext.defaultSpace;
- auto hackSamplerUsedRanges = findUsedRangeSetForSpace(&context, space);
-
- UInt binding = hackSamplerUsedRanges->usedResourceRanges[(int)LayoutResourceKind::DescriptorTableSlot].Allocate(nullptr, 1);
-
- programLayout->bindingForHackSampler = (int)binding;
-
- RefPtr<Variable> var = new Variable();
- var->nameAndLoc.name = compileReq->getNamePool()->getName("SLANG_hack_samplerForTexelFetch");
- var->type.type = getSamplerStateType(compileReq->mSession);
-
- auto typeLayout = new TypeLayout();
- typeLayout->type = var->type.type;
- typeLayout->addResourceUsage(LayoutResourceKind::DescriptorTableSlot, 1);
-
- auto varLayout = new VarLayout();
- varLayout->varDecl = makeDeclRef(var.Ptr());
- varLayout->typeLayout = typeLayout;
- auto resInfo = varLayout->AddResourceInfo(LayoutResourceKind::DescriptorTableSlot);
- resInfo->index = binding;
- resInfo->space = space;
-
- programLayout->hackSamplerVar = var;
-
- globalScopeStructLayout->fields.Add(varLayout);
- }
-
// We now have a bunch of layout information, which we should
// record into a suitable object that represents the program
RefPtr<VarLayout> globalVarLayout = new VarLayout();
@@ -2561,8 +2484,6 @@ RefPtr<ProgramLayout> specializeProgramLayout(
RefPtr<ProgramLayout> newProgramLayout;
newProgramLayout = new ProgramLayout();
newProgramLayout->targetRequest = targetReq;
- newProgramLayout->bindingForHackSampler = programLayout->bindingForHackSampler;
- newProgramLayout->hackSamplerVar = programLayout->hackSamplerVar;
newProgramLayout->globalGenericParams = programLayout->globalGenericParams;
List<RefPtr<TypeLayout>> paramTypeLayouts;
diff --git a/source/slang/slang.vcxproj b/source/slang/slang.vcxproj
index eeaf7410a..3be83b4f5 100644
--- a/source/slang/slang.vcxproj
+++ b/source/slang/slang.vcxproj
@@ -295,4 +295,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project> \ No newline at end of file
diff --git a/source/slang/slang.vcxproj.filters b/source/slang/slang.vcxproj.filters
index e2b17530e..d2efaf191 100644
--- a/source/slang/slang.vcxproj.filters
+++ b/source/slang/slang.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
diff --git a/source/slang/type-layout.h b/source/slang/type-layout.h
index f151a498a..35466a42c 100644
--- a/source/slang/type-layout.h
+++ b/source/slang/type-layout.h
@@ -458,11 +458,6 @@ public:
List<RefPtr<GenericParamLayout>> globalGenericParams;
Dictionary<String, GenericParamLayout*> globalGenericParamsMap;
- // HACK: binding to use when we have to create
- // a dummy sampler just to appease glslang
- int bindingForHackSampler = 0;
- RefPtr<VarDeclBase> hackSamplerVar;
-
TargetRequest* targetRequest = nullptr;
};
diff --git a/tests/bindings/glsl-parameter-blocks.slang.glsl b/tests/bindings/glsl-parameter-blocks.slang.glsl
index 01f49279a..3ade8bb6b 100644
--- a/tests/bindings/glsl-parameter-blocks.slang.glsl
+++ b/tests/bindings/glsl-parameter-blocks.slang.glsl
@@ -22,16 +22,16 @@ struct Test
vec4 a;
};
-layout(binding = 0, set = 1)
+layout(binding = 0)
uniform ParameterBlock_gTest
{
Test gTest;
};
-layout(binding = 1, set = 1)
+layout(binding = 1)
uniform texture2D gTest_t;
-layout(binding = 2, set = 1)
+layout(binding = 2)
uniform sampler gTest_s;
layout(location = 0)
diff --git a/tests/reflection/binding-gl.hlsl.expected b/tests/reflection/binding-gl.hlsl.expected
index 5ace782cc..1b5e7354f 100644
--- a/tests/reflection/binding-gl.hlsl.expected
+++ b/tests/reflection/binding-gl.hlsl.expected
@@ -93,13 +93,6 @@ standard output = {
"type": {
"kind": "samplerState"
}
- },
- {
- "name": "SLANG_hack_samplerForTexelFetch",
- "binding": {"kind": "descriptorTableSlot", "index": 4},
- "type": {
- "kind": "samplerState"
- }
}
],
"entryPoints": [
diff --git a/tests/reflection/binding-push-constant-gl.hlsl.expected b/tests/reflection/binding-push-constant-gl.hlsl.expected
index 6dd9d0fdd..ed6983364 100644
--- a/tests/reflection/binding-push-constant-gl.hlsl.expected
+++ b/tests/reflection/binding-push-constant-gl.hlsl.expected
@@ -122,13 +122,6 @@ standard output = {
"type": {
"kind": "samplerState"
}
- },
- {
- "name": "SLANG_hack_samplerForTexelFetch",
- "binding": {"kind": "descriptorTableSlot", "index": 4},
- "type": {
- "kind": "samplerState"
- }
}
],
"entryPoints": [
diff --git a/tests/reflection/cross-compile.slang.expected b/tests/reflection/cross-compile.slang.expected
index 3a8bea41e..3bb730f66 100644
--- a/tests/reflection/cross-compile.slang.expected
+++ b/tests/reflection/cross-compile.slang.expected
@@ -42,13 +42,6 @@ standard output = {
]
}
}
- },
- {
- "name": "SLANG_hack_samplerForTexelFetch",
- "binding": {"kind": "descriptorTableSlot", "index": 3},
- "type": {
- "kind": "samplerState"
- }
}
]
}
diff --git a/tests/reflection/parameter-block.slang.expected b/tests/reflection/parameter-block.slang.expected
index bc04d79ed..6821c46ca 100644
--- a/tests/reflection/parameter-block.slang.expected
+++ b/tests/reflection/parameter-block.slang.expected
@@ -39,13 +39,6 @@ standard output = {
"kind": "resource",
"baseShape": "texture2D"
}
- },
- {
- "name": "SLANG_hack_samplerForTexelFetch",
- "binding": {"kind": "descriptorTableSlot", "index": 1},
- "type": {
- "kind": "samplerState"
- }
}
]
}
diff --git a/tools/slang-test/slang-test.vcxproj b/tools/slang-test/slang-test.vcxproj
index b94f2f627..4987e1ce3 100644
--- a/tools/slang-test/slang-test.vcxproj
+++ b/tools/slang-test/slang-test.vcxproj
@@ -182,4 +182,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project> \ No newline at end of file
diff --git a/tools/slang-test/slang-test.vcxproj.filters b/tools/slang-test/slang-test.vcxproj.filters
index 3d80416f8..4c000ba58 100644
--- a/tools/slang-test/slang-test.vcxproj.filters
+++ b/tools/slang-test/slang-test.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">