Provide actual bounds to Shader primitives

... and allow for proper translation and scissoring.
This commit is contained in:
Héctor Ramón Jiménez 2023-11-28 23:13:38 +01:00
parent 100d15f306
commit ab7dae554c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 54 additions and 40 deletions

View file

@ -192,9 +192,9 @@ impl Backend {
format,
device,
queue,
pipeline.bounds,
target_size,
scale_factor,
transformation,
&mut self.pipeline_storage,
);
}
@ -327,17 +327,17 @@ impl Backend {
let _ = ManuallyDrop::into_inner(render_pass);
for pipeline in &layer.pipelines {
let bounds = (pipeline.bounds * scale_factor).snap();
let viewport = (pipeline.viewport * scale_factor).snap();
if bounds.width < 1 || bounds.height < 1 {
if viewport.width < 1 || viewport.height < 1 {
continue;
}
pipeline.primitive.render(
&self.pipeline_storage,
bounds,
target,
target_size,
viewport,
encoder,
);
}