summaryrefslogtreecommitdiff
path: root/source/slang/core.meta.slang.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/core.meta.slang.h')
-rw-r--r--source/slang/core.meta.slang.h67
1 files changed, 66 insertions, 1 deletions
diff --git a/source/slang/core.meta.slang.h b/source/slang/core.meta.slang.h
index a8ad43965..ba960b1d1 100644
--- a/source/slang/core.meta.slang.h
+++ b/source/slang/core.meta.slang.h
@@ -798,6 +798,67 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
sb << ")$z\")\n";
}
+
+ // CUDA
+ if (isMultisample)
+ {
+ }
+ else
+ {
+ if (access == SLANG_RESOURCE_ACCESS_READ_WRITE)
+ {
+ const int coordCount = kBaseTextureTypes[tt].coordCount;
+ const int vecCount = coordCount + int(isArray);
+
+ if( baseShape != TextureFlavor::Shape::ShapeCube )
+ {
+ sb << "__target_intrinsic(cuda, \"surf" << coordCount << "D";
+ if (isArray)
+ {
+ sb << "Layered";
+ }
+ sb << "read";
+ sb << "<$T0>($0";
+ for (int i = 0; i < coordCount; ++i)
+ {
+ sb << ", ($1)";
+ if (vecCount > 1)
+ {
+ sb << '.' << char(i + 'x');
+ }
+ }
+ if (isArray)
+ {
+ sb << ", int(($1)." << char(coordCount + 'x') << ")";
+ }
+ sb << ", SLANG_CUDA_BOUNDARY_MODE)\")\n";
+ }
+ else
+ {
+ sb << "__target_intrinsic(cuda, \"surfCubemap";
+ if (isArray)
+ {
+ sb << "Layered";
+ }
+ sb << "read";
+ sb << "<$T0>($0, ($1).x, ($1).y, ($1).z";
+ if (isArray)
+ {
+ sb << ", int(($1).w)";
+ }
+ sb << ", SLANG_CUDA_BOUNDARY_MODE)\")\n";
+ }
+ }
+ else if (access == SLANG_RESOURCE_ACCESS_READ)
+ {
+ // We can allow this on Texture1D
+ if( baseShape == TextureFlavor::Shape::Shape1D && isArray == false)
+ {
+ sb << "__target_intrinsic(cuda, \"tex1Dfetch<$T0>($0, ($1).x)\")\n";
+ }
+ }
+ }
+
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
if(isMultisample)
@@ -806,6 +867,7 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
}
sb << ");\n";
+ // GLSL
if (isMultisample)
{
sb << "__glsl_extension(GL_EXT_samplerless_texture_functions)";
@@ -825,6 +887,9 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt)
}
sb << ", $2)$z\")\n";
}
+
+
+
sb << "T Load(";
sb << "int" << loadCoordCount << " location";
if(isMultisample)
@@ -1359,7 +1424,7 @@ for (auto op : binaryOps)
sb << "__intrinsic_op(" << int(op.opCode) << ") matrix<" << resultType << ",N,M> operator" << op.opName << "(" << leftQual << "matrix<" << leftType << ",N,M> left, " << rightType << " right);\n";
}
}
-SLANG_RAW("#line 1341 \"core.meta.slang\"")
+SLANG_RAW("#line 1406 \"core.meta.slang\"")
SLANG_RAW("\n")
SLANG_RAW("\n")
SLANG_RAW("// Specialized function\n")