@@ -500,65 +500,5 @@ TEST(BufferBindingsGLESTest, RejectsTexturesBeyondTheCombinedLimit) {
500500 Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
501501}
502502
503- TEST (BufferBindingsGLESTest, SkipsRedundantSamplerConfigurationOnSameTexture) {
504- auto impl = MakeSixteenUnitMockImpl ();
505- auto * raw_impl = impl.get ();
506- std::shared_ptr<MockGLES> mock_gl = MockGLES::Init (std::move (impl));
507- BoundTexturesFixture fixture (
508- std::make_unique<ProcTableGLES>(kMockResolverGLES ));
509- fixture.AddTextures (ShaderStage::kFragment , 1 );
510- ASSERT_TRUE (fixture.reactor ->React ());
511-
512- BufferBindingsGLES bindings;
513- bindings.SetUniformBindings (std::move (fixture.uniform_bindings ));
514- std::vector<BufferResource> bound_buffers;
515-
516- // First bind on ES 3.0 configures MIN_FILTER, MAG_FILTER, MAX_LEVEL, WRAP_S,
517- // WRAP_T (5 calls). Second bind with the same sampler descriptor skips all
518- // TexParameteri calls.
519- EXPECT_CALL (*raw_impl, TexParameteri (GL_TEXTURE_2D , _, _)).Times (5 );
520-
521- EXPECT_TRUE (bindings.BindUniformData (
522- fixture.reactor ->GetProcTable (), fixture.bound_textures , bound_buffers,
523- Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
524- EXPECT_TRUE (bindings.BindUniformData (
525- fixture.reactor ->GetProcTable (), fixture.bound_textures , bound_buffers,
526- Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
527-
528- // Changing the sampler descriptor must re-configure the texture (5 calls).
529- SamplerDescriptor linear_desc;
530- linear_desc.min_filter = MinMagFilter::kLinear ;
531- linear_desc.mag_filter = MinMagFilter::kLinear ;
532- fixture.bound_textures [0 ].sampler =
533- fixture.sampler_library ->GetSampler (linear_desc);
534- EXPECT_CALL (*raw_impl, TexParameteri (GL_TEXTURE_2D , _, _)).Times (5 );
535- EXPECT_TRUE (bindings.BindUniformData (
536- fixture.reactor ->GetProcTable (), fixture.bound_textures , bound_buffers,
537- Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
538-
539- // Wrapped external textures must bypass the sampler parameter cache and
540- // re-emit TexParameteri on every bind (5 calls per bind = 10 calls for 2
541- // consecutive binds with the same sampler descriptor).
542- TextureDescriptor wrapped_desc;
543- wrapped_desc.storage_mode = StorageMode::kDevicePrivate ;
544- wrapped_desc.type = TextureType::kTexture2D ;
545- wrapped_desc.format = PixelFormat::kR8G8B8A8UNormInt ;
546- wrapped_desc.size = {1 , 1 };
547- wrapped_desc.mip_count = 1u ;
548- wrapped_desc.usage = TextureUsage::kShaderRead ;
549- auto wrapped_texture = TextureGLES::WrapTexture (
550- fixture.reactor , wrapped_desc,
551- fixture.reactor ->CreateHandle (HandleType::kTexture , 99u ));
552- fixture.bound_textures [0 ].texture =
553- TextureResource (fixture.metadata [0 ].get (), std::move (wrapped_texture));
554- EXPECT_CALL (*raw_impl, TexParameteri (GL_TEXTURE_2D , _, _)).Times (10 );
555- EXPECT_TRUE (bindings.BindUniformData (
556- fixture.reactor ->GetProcTable (), fixture.bound_textures , bound_buffers,
557- Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
558- EXPECT_TRUE (bindings.BindUniformData (
559- fixture.reactor ->GetProcTable (), fixture.bound_textures , bound_buffers,
560- Range{0 , fixture.bound_textures .size ()}, Range{0 , 0 }));
561- }
562-
563503} // namespace testing
564504} // namespace impeller
0 commit comments