mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
rename allow_point_size to allow_and_force_point_size (#2280)
This commit is contained in:
@@ -210,10 +210,13 @@ impl Default for Options {
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
|
||||
pub struct PipelineOptions {
|
||||
/// Allow `BuiltIn::PointSize` in the vertex shader.
|
||||
/// Allow `BuiltIn::PointSize` and inject it if doesn't exist.
|
||||
///
|
||||
/// Metal doesn't like this for non-point primitive topologies.
|
||||
pub allow_point_size: bool,
|
||||
/// Metal doesn't like this for non-point primitive topologies and requires it for
|
||||
/// point primitive topologies.
|
||||
///
|
||||
/// Enable this for vertex shaders with point primitive topologies.
|
||||
pub allow_and_force_point_size: bool,
|
||||
}
|
||||
|
||||
impl Options {
|
||||
|
||||
@@ -2321,7 +2321,7 @@ impl<W: Write> Writer<W> {
|
||||
member.binding
|
||||
{
|
||||
has_point_size = true;
|
||||
if !context.pipeline_options.allow_point_size {
|
||||
if !context.pipeline_options.allow_and_force_point_size {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -2358,7 +2358,7 @@ impl<W: Write> Writer<W> {
|
||||
|
||||
if let FunctionOrigin::EntryPoint(ep_index) = context.origin {
|
||||
let stage = context.module.entry_points[ep_index as usize].stage;
|
||||
if context.pipeline_options.allow_point_size
|
||||
if context.pipeline_options.allow_and_force_point_size
|
||||
&& stage == crate::ShaderStage::Vertex
|
||||
&& !has_point_size
|
||||
{
|
||||
@@ -3769,7 +3769,7 @@ impl<W: Write> Writer<W> {
|
||||
|
||||
if let crate::Binding::BuiltIn(crate::BuiltIn::PointSize) = *binding {
|
||||
has_point_size = true;
|
||||
if !pipeline_options.allow_point_size {
|
||||
if !pipeline_options.allow_and_force_point_size {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -3790,7 +3790,7 @@ impl<W: Write> Writer<W> {
|
||||
writeln!(self.out, ";")?;
|
||||
}
|
||||
|
||||
if pipeline_options.allow_point_size
|
||||
if pipeline_options.allow_and_force_point_size
|
||||
&& ep.stage == crate::ShaderStage::Vertex
|
||||
&& !has_point_size
|
||||
{
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
zero_initialize_workgroup_memory: true,
|
||||
),
|
||||
msl_pipeline: (
|
||||
allow_point_size: true,
|
||||
allow_and_force_point_size: true,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user