mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/resize-tweaks' into 'master'
Resize related tweaks See merge request veloren/veloren!2448
This commit is contained in:
commit
a41c7a9a5b
@ -188,7 +188,9 @@ impl ShadowMap {
|
|||||||
let diag_two_size = u32::checked_next_power_of_two(diag_size)
|
let diag_two_size = u32::checked_next_power_of_two(diag_size)
|
||||||
.filter(|&e| e <= max_texture_size)
|
.filter(|&e| e <= max_texture_size)
|
||||||
// Limit to max texture resolution rather than error.
|
// Limit to max texture resolution rather than error.
|
||||||
.unwrap_or(max_texture_size);
|
.unwrap_or(max_texture_size)
|
||||||
|
// Make sure we don't try to create a zero sized texture (divided by 4 below)
|
||||||
|
.max(4);
|
||||||
|
|
||||||
let point_shadow_tex = wgpu::TextureDescriptor {
|
let point_shadow_tex = wgpu::TextureDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
|
@ -711,14 +711,9 @@ impl IcedRenderer {
|
|||||||
if intersection.is_valid() && intersection.size().map(|s| s > 0).reduce_and() {
|
if intersection.is_valid() && intersection.size().map(|s| s > 0).reduce_and() {
|
||||||
intersection
|
intersection
|
||||||
} else {
|
} else {
|
||||||
// Create a aabr with width 1 and height 1, technically
|
// If the intersection is invalid or zero sized we don't need to process
|
||||||
// it would be more correct to do it with 0,0 but that's
|
// the content primitive
|
||||||
// a validation error in wgpu so enjoy your funky pixel
|
return;
|
||||||
// in the top left of your screen
|
|
||||||
Aabr {
|
|
||||||
min: Vec2::zero(),
|
|
||||||
max: Vec2::one(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Not expecting this case: new_scissor == current_scissor
|
// Not expecting this case: new_scissor == current_scissor
|
||||||
@ -737,8 +732,8 @@ impl IcedRenderer {
|
|||||||
self.draw_commands.push(DrawCommand::Scissor(new_scissor));
|
self.draw_commands.push(DrawCommand::Scissor(new_scissor));
|
||||||
|
|
||||||
// TODO: support nested clips?
|
// TODO: support nested clips?
|
||||||
// TODO: if last command is a clip changing back to the default replace it with
|
// TODO: if previous command was a clip changing back to the default replace it
|
||||||
// this
|
// with this
|
||||||
// TODO: cull primitives outside the current scissor
|
// TODO: cull primitives outside the current scissor
|
||||||
|
|
||||||
// Renderer child
|
// Renderer child
|
||||||
|
Loading…
Reference in New Issue
Block a user