diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-21 11:34:56 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-21 11:59:52 -0700 |
| commit | 1eb5a1bc44e950b6b74c0907984adfe4d971917c (patch) | |
| tree | 116aa4ce97675dc8a6690686713b31bd07560c71 /source | |
| parent | c92d06cc87370f7db478bdbc2d77b080f013632e (diff) | |
Revamp definitions of texture `Load` and `GetDimensions`
These are annoyingly subtle.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-stdlib.cpp | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index e44b7131b..7643b3b85 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -1385,6 +1385,11 @@ namespace Slang sb << ", " << t << "elements"; } + if(isMultisample) + { + sb << ", " << t << "sampleCount"; + } + if(includeMipInfo) sb << ", " << t << "numberOfLevels"; @@ -1401,22 +1406,35 @@ namespace Slang if( kBaseTextureTypes[tt].coordCount + isArray < 4 ) { + int loadCoordCount = kBaseTextureTypes[tt].coordCount + isArray + (isMultisample?0:1); + sb << "T Load("; - sb << "int" << kBaseTextureTypes[tt].coordCount + isArray + 1 << " location);\n"; + sb << "int" << loadCoordCount << " location"; + if(isMultisample) + { + sb << ", int sampleIndex"; + } + sb << ");\n"; - if( !isMultisample ) + sb << "T Load("; + sb << "int" << loadCoordCount << " location"; + if(isMultisample) { - sb << "T Load("; - sb << "int" << kBaseTextureTypes[tt].coordCount + isArray + 1 << " location, "; - sb << "int" << kBaseTextureTypes[tt].coordCount << " offset);\n"; + sb << ", int sampleIndex"; } - else + sb << ", int" << loadCoordCount << " offset"; + sb << ");\n"; + + + sb << "T Load("; + sb << "int" << loadCoordCount << " location"; + if(isMultisample) { - sb << "T Load("; - sb << "int" << kBaseTextureTypes[tt].coordCount + isArray + 1 << " location, "; - sb << "int sampleIndex, "; - sb << "int" << kBaseTextureTypes[tt].coordCount << " offset);\n"; + sb << ", int sampleIndex"; } + sb << ", int" << kBaseTextureTypes[tt].coordCount << " offset"; + sb << ", out uint status"; + sb << ");\n"; } if(baseShape != TextureType::ShapeCube) |
