forked from 1b-agent/opencadstudio-upstream
fix(render): eliminate depth-write edge conflict at polyline arc joints
This commit is contained in:
1 parent
f0cc4ffba8
commit
2875d4ae61
3 files changed
+16
-4
No files matched your search
@@ -145,7 +145,7 @@ pub fn create_pipelines(
|
|||||||
},
|
},
|
||||||
depth_stencil: Some(wgpu::DepthStencilState {
|
depth_stencil: Some(wgpu::DepthStencilState {
|
||||||
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
||||||
depth_write_enabled: Some(true),
|
depth_write_enabled: Some(false),
|
||||||
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
||||||
stencil: content_stencil.clone(),
|
stencil: content_stencil.clone(),
|
||||||
bias: wgpu::DepthBiasState::default(),
|
bias: wgpu::DepthBiasState::default(),
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ pub fn create_pipelines(
|
|||||||
},
|
},
|
||||||
depth_stencil: Some(wgpu::DepthStencilState {
|
depth_stencil: Some(wgpu::DepthStencilState {
|
||||||
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
||||||
depth_write_enabled: Some(true),
|
depth_write_enabled: Some(false),
|
||||||
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
||||||
stencil: content_stencil.clone(),
|
stencil: content_stencil.clone(),
|
||||||
bias: wgpu::DepthBiasState::default(),
|
bias: wgpu::DepthBiasState::default(),
|
||||||
|
|||||||
@@ -2449,11 +2449,17 @@ impl Pipeline {
|
|||||||
if instances.is_empty() {
|
if instances.is_empty() {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
|
let mut sorted = instances.to_vec();
|
||||||
|
sorted.sort_by(|a, b| {
|
||||||
|
a.params[2]
|
||||||
|
.partial_cmp(&b.params[2])
|
||||||
|
.unwrap_or(std::cmp::Ordering::Equal)
|
||||||
|
});
|
||||||
vec![CircleGpu::from_instances(
|
vec![CircleGpu::from_instances(
|
||||||
device,
|
device,
|
||||||
queue,
|
queue,
|
||||||
"viewer.circles",
|
"viewer.circles",
|
||||||
instances,
|
&sorted,
|
||||||
)]
|
)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2489,11 +2495,17 @@ impl Pipeline {
|
|||||||
if instances.is_empty() {
|
if instances.is_empty() {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
|
let mut sorted = instances.to_vec();
|
||||||
|
sorted.sort_by(|a, b| {
|
||||||
|
a.params[2]
|
||||||
|
.partial_cmp(&b.params[2])
|
||||||
|
.unwrap_or(std::cmp::Ordering::Equal)
|
||||||
|
});
|
||||||
vec![EllipseGpu::from_instances(
|
vec![EllipseGpu::from_instances(
|
||||||
device,
|
device,
|
||||||
queue,
|
queue,
|
||||||
"viewer.ellipses",
|
"viewer.ellipses",
|
||||||
instances,
|
&sorted,
|
||||||
)]
|
)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user