Fix: Keying Screen and anti-aliasing produce bad results
The Keying Screen and the Anti-Aliasing nodes produce bad results in the viewport compositor. This is because their cached resources are allocated from the GPU texture pool, so they might get overwritten. To fix this, we make sure those are not allocated from the texture pool.
This commit is contained in:
@@ -143,7 +143,7 @@ KeyingScreen::KeyingScreen(Context &context,
|
||||
return;
|
||||
}
|
||||
|
||||
this->result.allocate_texture(Domain(size));
|
||||
this->result.allocate_texture(Domain(size), false);
|
||||
if (context.use_gpu()) {
|
||||
this->compute_gpu(context, smoothness, marker_positions, marker_colors);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void SMAAPrecomputedTextures::compute_gpu()
|
||||
void SMAAPrecomputedTextures::compute_cpu()
|
||||
{
|
||||
const int2 search_texture_size = int2(SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT);
|
||||
search_texture.allocate_texture(Domain(search_texture_size));
|
||||
search_texture.allocate_texture(Domain(search_texture_size), false);
|
||||
parallel_for(search_texture_size, [&](const int2 texel) {
|
||||
const float value = searchTexBytes[int64_t(texel.y) * search_texture_size.x + texel.x] /
|
||||
255.0f;
|
||||
@@ -97,7 +97,7 @@ void SMAAPrecomputedTextures::compute_cpu()
|
||||
});
|
||||
|
||||
const int2 area_texture_size = int2(AREATEX_WIDTH, AREATEX_HEIGHT);
|
||||
area_texture.allocate_texture(Domain(area_texture_size));
|
||||
area_texture.allocate_texture(Domain(area_texture_size), false);
|
||||
parallel_for(area_texture_size, [&](const int2 texel) {
|
||||
const float2 value = float2(uchar2(areaTexBytes +
|
||||
(int64_t(texel.y) * area_texture_size.x + texel.x) * 2)) /
|
||||
|
||||
Reference in New Issue
Block a user