Re-land "D3D11: Fix Integer Texture Cube mip mapping."
We were missing both the correct SRV parameter, as well as the full
computation of the mip level in the HLSL.
Re-land makes the mip computation only happen with implicit sampling.
Before it would confuse the LOD0 computation.
BUG=angleproject:1208
TEST=dEQP-GLES3.functional.texture.*
Change-Id: I4b579033afe5cd1aca1f2d017e48a74c7fc324cc
Reviewed-on: https://chromium-review.googlesource.com/314330
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 7e8302f..2c4ad33 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -904,6 +904,17 @@
out << " t.x = (u * 0.5f / m) + 0.5f;\n";
out << " t.y = (v * 0.5f / m) + 0.5f;\n";
+
+ // Mip level computation.
+ if (textureFunction->method == TextureFunction::IMPLICIT)
+ {
+ out << " float2 tSized = float2(t.x * width, t.y * height);\n"
+ " float2 dx = ddx(tSized);\n"
+ " float2 dy = ddy(tSized);\n"
+ " float lod = 0.5f * log2(max(dot(dx, dx), dot(dy, dy)));\n"
+ " mip = uint(min(max(round(lod), 0), levels - 1));\n"
+ " x.GetDimensions(mip, width, height, layers, levels);\n";
+ }
}
else if (IsIntegerSampler(textureFunction->sampler) &&
textureFunction->method != TextureFunction::FETCH)
diff --git a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
index 3913b59..2376dec 100644
--- a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
@@ -2225,7 +2225,7 @@
{
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY;
srvDesc.Texture2DArray.MostDetailedMip = mTopLevel + baseLevel;
- srvDesc.Texture2DArray.MipLevels = 1;
+ srvDesc.Texture2DArray.MipLevels = mipLevels;
srvDesc.Texture2DArray.FirstArraySlice = 0;
srvDesc.Texture2DArray.ArraySize = CUBE_FACE_COUNT;
}
diff --git a/src/tests/deqp_support/deqp_gles3_test_expectations.txt b/src/tests/deqp_support/deqp_gles3_test_expectations.txt
index b8aff27..04604f9 100644
--- a/src/tests/deqp_support/deqp_gles3_test_expectations.txt
+++ b/src/tests/deqp_support/deqp_gles3_test_expectations.txt
@@ -274,64 +274,11 @@
1095 WIN : dEQP-GLES3.functional.texture.swizzle.multi_channel.rg_all_zero = FAIL
1095 WIN : dEQP-GLES3.functional.texture.swizzle.multi_channel.rgb_all_zero = FAIL
1095 WIN : dEQP-GLES3.functional.texture.swizzle.multi_channel.rgba_all_zero = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgba8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb10_a2ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.rg8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_teximage2d.r8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.random_teximage2d.cube_0 = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.random_teximage2d.cube_3 = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.random_teximage2d.cube_7 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth_component32f = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth32f_stencil8 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component32f = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component24 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth32f_stencil8 = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb10_a2ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgb8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rg8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.r8ui_cube = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth_component32f = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth32f_stencil8 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copyteximage2d.cube_luminance = FAIL
@@ -354,31 +301,6 @@
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth_component24_2d_array = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component32f_2d_array = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth32f_stencil8_2d_array = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgba8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb10_a2ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rgb8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.rg8ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r32i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r32ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r16i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r16ui_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r8i_cube = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.texstorage2d.format.r8ui_cube = FAIL
1095 WIN : dEQP-GLES3.functional.texture.units.2_units.only_2d.3 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.units.2_units.only_2d.5 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.units.2_units.only_2d.7 = FAIL
@@ -541,46 +463,6 @@
1097 WIN : dEQP-GLES3.functional.fbo.render.resize.tex2d_rgba16f_stencil_rbo_stencil_index8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.render.resize.tex2d_rgba8_stencil_rbo_stencil_index8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.render.recreate_depth_stencil.tex2d_rgba8_stencil_rbo_stencil_index8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba32i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba32ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba16i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba16ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba8i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba8ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.srgb8_alpha8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgb10_a2 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgb10_a2ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba4 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgb5_a1 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgb8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgb565 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg32i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg32ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg16i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg16ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg8i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg8ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r32i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r32ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r16i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r16ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r8 = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r8i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r8ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba32f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rgba16f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r11f_g11f_b10f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg32f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.rg16f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r32f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.texcube.r16f = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.tex2darray.rgba32i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.tex2darray.rgba32ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.tex2darray.rgba16i = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.tex2darray.rgba16ui = FAIL
-1097 WIN : dEQP-GLES3.functional.fbo.color.tex2darray.rgba8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.color.tex3d.rgba32i = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.color.tex3d.rgba16ui = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.color.tex3d.rgba8i = FAIL