{-# language CPP #-}
-- No documentation found for Chapter "PolygonMode"
module Vulkan.Core10.Enums.PolygonMode  (PolygonMode( POLYGON_MODE_FILL
                                                    , POLYGON_MODE_LINE
                                                    , POLYGON_MODE_POINT
                                                    , POLYGON_MODE_FILL_RECTANGLE_NV
                                                    , ..
                                                    )) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showsPrec)
import Vulkan.Zero (Zero)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))

-- | VkPolygonMode - Control polygon rasterization mode
--
-- = Description
--
-- These modes affect only the final rasterization of polygons: in
-- particular, a polygon’s vertices are shaded and the polygon is clipped
-- and possibly culled before these modes are applied.
--
-- If
-- 'Vulkan.Extensions.VK_KHR_maintenance5.PhysicalDeviceMaintenance5PropertiesKHR'::@polygonModePointSize@
-- is set to 'Vulkan.Core10.FundamentalTypes.TRUE', the point size of the
-- final rasterization of polygons is taken from @PointSize@ when
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-polygonmode polygon mode>
-- is 'POLYGON_MODE_POINT'.
--
-- Otherwise, if
-- 'Vulkan.Extensions.VK_KHR_maintenance5.PhysicalDeviceMaintenance5PropertiesKHR'::@polygonModePointSize@
-- is set to 'Vulkan.Core10.FundamentalTypes.FALSE', the point size of the
-- final rasterization of polygons is 1.0 when
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-polygonmode polygon mode>
-- is 'POLYGON_MODE_POINT'.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
-- 'Vulkan.Core10.Pipeline.PipelineRasterizationStateCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_extended_dynamic_state3.cmdSetPolygonModeEXT'
newtype PolygonMode = PolygonMode Int32
  deriving newtype (PolygonMode -> PolygonMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolygonMode -> PolygonMode -> Bool
$c/= :: PolygonMode -> PolygonMode -> Bool
== :: PolygonMode -> PolygonMode -> Bool
$c== :: PolygonMode -> PolygonMode -> Bool
Eq, Eq PolygonMode
PolygonMode -> PolygonMode -> Bool
PolygonMode -> PolygonMode -> Ordering
PolygonMode -> PolygonMode -> PolygonMode
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: PolygonMode -> PolygonMode -> PolygonMode
$cmin :: PolygonMode -> PolygonMode -> PolygonMode
max :: PolygonMode -> PolygonMode -> PolygonMode
$cmax :: PolygonMode -> PolygonMode -> PolygonMode
>= :: PolygonMode -> PolygonMode -> Bool
$c>= :: PolygonMode -> PolygonMode -> Bool
> :: PolygonMode -> PolygonMode -> Bool
$c> :: PolygonMode -> PolygonMode -> Bool
<= :: PolygonMode -> PolygonMode -> Bool
$c<= :: PolygonMode -> PolygonMode -> Bool
< :: PolygonMode -> PolygonMode -> Bool
$c< :: PolygonMode -> PolygonMode -> Bool
compare :: PolygonMode -> PolygonMode -> Ordering
$ccompare :: PolygonMode -> PolygonMode -> Ordering
Ord, Ptr PolygonMode -> IO PolygonMode
Ptr PolygonMode -> Int -> IO PolygonMode
Ptr PolygonMode -> Int -> PolygonMode -> IO ()
Ptr PolygonMode -> PolygonMode -> IO ()
PolygonMode -> Int
forall b. Ptr b -> Int -> IO PolygonMode
forall b. Ptr b -> Int -> PolygonMode -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr PolygonMode -> PolygonMode -> IO ()
$cpoke :: Ptr PolygonMode -> PolygonMode -> IO ()
peek :: Ptr PolygonMode -> IO PolygonMode
$cpeek :: Ptr PolygonMode -> IO PolygonMode
pokeByteOff :: forall b. Ptr b -> Int -> PolygonMode -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> PolygonMode -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO PolygonMode
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PolygonMode
pokeElemOff :: Ptr PolygonMode -> Int -> PolygonMode -> IO ()
$cpokeElemOff :: Ptr PolygonMode -> Int -> PolygonMode -> IO ()
peekElemOff :: Ptr PolygonMode -> Int -> IO PolygonMode
$cpeekElemOff :: Ptr PolygonMode -> Int -> IO PolygonMode
alignment :: PolygonMode -> Int
$calignment :: PolygonMode -> Int
sizeOf :: PolygonMode -> Int
$csizeOf :: PolygonMode -> Int
Storable, PolygonMode
forall a. a -> Zero a
zero :: PolygonMode
$czero :: PolygonMode
Zero)

-- | 'POLYGON_MODE_FILL' specifies that polygons are rendered using the
-- polygon rasterization rules in this section.
pattern $bPOLYGON_MODE_FILL :: PolygonMode
$mPOLYGON_MODE_FILL :: forall {r}. PolygonMode -> ((# #) -> r) -> ((# #) -> r) -> r
POLYGON_MODE_FILL = PolygonMode 0

-- | 'POLYGON_MODE_LINE' specifies that polygon edges are drawn as line
-- segments.
pattern $bPOLYGON_MODE_LINE :: PolygonMode
$mPOLYGON_MODE_LINE :: forall {r}. PolygonMode -> ((# #) -> r) -> ((# #) -> r) -> r
POLYGON_MODE_LINE = PolygonMode 1

-- | 'POLYGON_MODE_POINT' specifies that polygon vertices are drawn as
-- points.
pattern $bPOLYGON_MODE_POINT :: PolygonMode
$mPOLYGON_MODE_POINT :: forall {r}. PolygonMode -> ((# #) -> r) -> ((# #) -> r) -> r
POLYGON_MODE_POINT = PolygonMode 2

-- | 'POLYGON_MODE_FILL_RECTANGLE_NV' specifies that polygons are rendered
-- using polygon rasterization rules, modified to consider a sample within
-- the primitive if the sample location is inside the axis-aligned bounding
-- box of the triangle after projection. Note that the barycentric weights
-- used in attribute interpolation /can/ extend outside the range [0,1]
-- when these primitives are shaded. Special treatment is given to a sample
-- position on the boundary edge of the bounding box. In such a case, if
-- two rectangles lie on either side of a common edge (with identical
-- endpoints) on which a sample position lies, then exactly one of the
-- triangles /must/ produce a fragment that covers that sample during
-- rasterization.
--
-- Polygons rendered in 'POLYGON_MODE_FILL_RECTANGLE_NV' mode /may/ be
-- clipped by the frustum or by user clip planes. If clipping is applied,
-- the triangle is culled rather than clipped.
--
-- Area calculation and facingness are determined for
-- 'POLYGON_MODE_FILL_RECTANGLE_NV' mode using the triangle’s vertices.
pattern $bPOLYGON_MODE_FILL_RECTANGLE_NV :: PolygonMode
$mPOLYGON_MODE_FILL_RECTANGLE_NV :: forall {r}. PolygonMode -> ((# #) -> r) -> ((# #) -> r) -> r
POLYGON_MODE_FILL_RECTANGLE_NV = PolygonMode 1000153000

{-# COMPLETE
  POLYGON_MODE_FILL
  , POLYGON_MODE_LINE
  , POLYGON_MODE_POINT
  , POLYGON_MODE_FILL_RECTANGLE_NV ::
    PolygonMode
  #-}

conNamePolygonMode :: String
conNamePolygonMode :: String
conNamePolygonMode = String
"PolygonMode"

enumPrefixPolygonMode :: String
enumPrefixPolygonMode :: String
enumPrefixPolygonMode = String
"POLYGON_MODE_"

showTablePolygonMode :: [(PolygonMode, String)]
showTablePolygonMode :: [(PolygonMode, String)]
showTablePolygonMode =
  [ (PolygonMode
POLYGON_MODE_FILL, String
"FILL")
  , (PolygonMode
POLYGON_MODE_LINE, String
"LINE")
  , (PolygonMode
POLYGON_MODE_POINT, String
"POINT")
  , (PolygonMode
POLYGON_MODE_FILL_RECTANGLE_NV, String
"FILL_RECTANGLE_NV")
  ]

instance Show PolygonMode where
  showsPrec :: Int -> PolygonMode -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixPolygonMode
      [(PolygonMode, String)]
showTablePolygonMode
      String
conNamePolygonMode
      (\(PolygonMode Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read PolygonMode where
  readPrec :: ReadPrec PolygonMode
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixPolygonMode
      [(PolygonMode, String)]
showTablePolygonMode
      String
conNamePolygonMode
      Int32 -> PolygonMode
PolygonMode