summaryrefslogtreecommitdiffstats
path: root/tools/render-test/shader-input-layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/render-test/shader-input-layout.cpp')
-rw-r--r--tools/render-test/shader-input-layout.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp
index 108483a2a..f9d6a60e1 100644
--- a/tools/render-test/shader-input-layout.cpp
+++ b/tools/render-test/shader-input-layout.cpp
@@ -452,6 +452,12 @@ namespace renderer_test
entry.textureDesc.format = format;
entry.bufferDesc.format = format;
}
+ else if(word == "mipMaps")
+ {
+ parser.Read("=");
+ entry.textureDesc.mipMapCount = int(parser.ReadInt());
+ }
+
if (parser.LookAhead(","))
parser.Read(",");
else
@@ -974,7 +980,12 @@ namespace renderer_test
arraySize *= 6;
output.arraySize = arraySize;
output.textureSize = inputDesc.size;
- output.mipLevels = Math::Log2Floor(output.textureSize) + 1;
+
+ const Index maxMipLevels = Math::Log2Floor(output.textureSize) + 1;
+ Index mipLevels = (inputDesc.mipMapCount <= 0) ? maxMipLevels : inputDesc.mipMapCount;
+ mipLevels = (mipLevels > maxMipLevels) ? maxMipLevels : mipLevels;
+
+ output.mipLevels = int(mipLevels);
output.dataBuffer.setCount(output.mipLevels * output.arraySize);
int slice = 0;