rename allow_point_size to allow_and_force_point_size (#2280)

This commit is contained in:
Teodor Tanasoaia
2023-06-22 15:36:54 +02:00
committed by GitHub
parent f915d39a87
commit ffe2308a60
3 changed files with 11 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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
{

View File

@@ -26,6 +26,6 @@
zero_initialize_workgroup_memory: true,
),
msl_pipeline: (
allow_point_size: true,
allow_and_force_point_size: true,
),
)