Manually compute the mipmap size for the textureSize builtin.
There were two issues with the current implementation:
* The GetDimensions function already takes into account the base level of the
SRV.
* The GetDimensions function returns doesn't return valid sizes for levels
that don't exist in the SRV. Instead, manually do the lod offset.
BUG=angleproject:931
BUG=angleproject:1316
TEST=dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2d_fixed_vertex
Change-Id: I63259b563a42b93b73949e0ef7ac412099a42f13
Reviewed-on: https://chromium-review.googlesource.com/376099
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 0051d2d..6391782 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -605,7 +605,9 @@
}
}
- mTextureFunctionHLSL->textureFunctionHeader(out, mOutputType);
+ bool getDimensionsIgnoresBaseLevel =
+ (mCompileOptions & SH_HLSL_GET_DIMENSIONS_IGNORES_BASE_LEVEL) != 0;
+ mTextureFunctionHLSL->textureFunctionHeader(out, mOutputType, getDimensionsIgnoresBaseLevel);
if (mUsesFragCoord)
{