Browse Source

TextureTools: don't clear the output in DistanceField.

The test passes now. This made the benchmark run significantly faster.
~200 µs instead of 670. Are clears really taking up more time than all
those texture fetches? Strange.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
a2554cb656
  1. 1
      src/Magnum/TextureTools/DistanceField.cpp
  2. 4
      src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp

1
src/Magnum/TextureTools/DistanceField.cpp

@ -205,7 +205,6 @@ void DistanceField::operator()(GL::Texture2D& input, GL::Framebuffer& output, co
output
.setViewport(rectangle)
.clear(GL::FramebufferClear::Color)
.bind();
_state->shader

4
src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp

@ -107,7 +107,7 @@ DistanceFieldGLTest::DistanceFieldGLTest() {
&DistanceFieldGLTest::sizeRatioNotMultipleOfTwo});
#ifndef MAGNUM_TARGET_WEBGL
addBenchmarks({&DistanceFieldGLTest::benchmark}, 5, BenchmarkType::GpuTime);
addBenchmarks({&DistanceFieldGLTest::benchmark}, 10, BenchmarkType::GpuTime);
#endif
/* Load the plugin directly from the build tree. Otherwise it's either
@ -595,7 +595,7 @@ void DistanceFieldGLTest::benchmark() {
DistanceField distanceField{32};
CORRADE_BENCHMARK(25) {
CORRADE_BENCHMARK(50) {
distanceField(input, framebuffer, {{}, Vector2i{64}}
#ifdef MAGNUM_TARGET_GLES
, inputImage->size()

Loading…
Cancel
Save