mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
st/glsl_to_tgsi: teach the DCE pass about bindless samplers/images
When a texture (or an image) instruction uses a bindless sampler (respectively a bindless image), make sure the DCE pass won't remove code when the resource is a temporary variable. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
5d59226a7f
commit
77cbded995
1 changed files with 15 additions and 0 deletions
|
|
@ -5290,6 +5290,21 @@ glsl_to_tgsi_visitor::eliminate_dead_code(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inst->resource.file == PROGRAM_TEMPORARY) {
|
||||
int src_chans;
|
||||
|
||||
src_chans = 1 << GET_SWZ(inst->resource.swizzle, 0);
|
||||
src_chans |= 1 << GET_SWZ(inst->resource.swizzle, 1);
|
||||
src_chans |= 1 << GET_SWZ(inst->resource.swizzle, 2);
|
||||
src_chans |= 1 << GET_SWZ(inst->resource.swizzle, 3);
|
||||
|
||||
for (int c = 0; c < 4; c++) {
|
||||
if (src_chans & (1 << c))
|
||||
writes[4 * inst->resource.index + c] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue