After much experimenting, I think that
maybe I understand what's happening here. Maybe someone can confirm. This is slightly unexpected, but I can understand if this is the way it works. First, an expanded outline of what I'm doing:
sf::RenderTexture finalTexture;
finalTexture.create(32, 32);
finalTexture.clear();
sf::RenderTexture tempTexture;
tempTexture.create(16, 16);
for (int i = 0; i < 4; ++i)
{
tempTexture.clear();
// draw varied stuff in tempTexture here
tempTexture.display();
sf::Sprite sprite(tempTexture.getTexture()); // sf::Sprite sprite(sf::Texture(tempTexture.getTexture())); here would fix the problem
sprite.setPosition((i % 2) * 16, (i / 2) * 16);
finalTexture.draw(sprite);
// alternately, finalTexture.display(); here would also fix the problem
}
finalTexture.display();
So, I am guessing that finalTexture.draw() is actually deferred until finalTexture.display(). Whatever command-list kind of system is used for the deferral, it must store a reference to tempTexture's texture, rather than a copy of its contents at the time the draw call happened. This is why explicitly making copies of tempTexture's texture solves the problem, but also forcing the draw to happen each iteration also solves the problem.
Is this right?