Pass texture base level to shaders on D3D11
The base level is passed to shaders in an array included in the driver
uniform block. This is done on feature levels above 9_3, which treat
samplers as indices to sampler arrays in shaders.
A separate uniform block couldn't be used for the sampler metadata,
since that would bring the number of available uniform blocks down to
below minimum level defined by GLES 3.0.
BUG=angleproject:596
TEST=angle_end2end_tests
Change-Id: Ie040521402f9996d51a978aeeba9222e9dd761ce
Reviewed-on: https://chromium-review.googlesource.com/326290
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 253b966..90aa734 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -512,6 +512,11 @@
out << " float2 dx_ViewScale : packoffset(c3);\n";
}
+ if (mOutputType == SH_HLSL_4_1_OUTPUT)
+ {
+ mUniformHLSL->samplerMetadataUniforms(out, "c4");
+ }
+
out << "};\n";
}
else
@@ -614,6 +619,11 @@
out << " float2 dx_ViewCoords : packoffset(c2);\n";
out << " float2 dx_ViewScale : packoffset(c3);\n";
+ if (mOutputType == SH_HLSL_4_1_OUTPUT)
+ {
+ mUniformHLSL->samplerMetadataUniforms(out, "c4");
+ }
+
out << "};\n"
"\n";
}