Beispiel #1
0
        public VkRasterizerState(FaceCullingMode cullMode, TriangleFillMode fillMode, bool isDepthClipEnabled, bool isScissorTestEnabled)
        {
            CullMode             = cullMode;
            FillMode             = fillMode;
            IsDepthClipEnabled   = isDepthClipEnabled;
            IsScissorTestEnabled = isScissorTestEnabled;

            VkPipelineRasterizationStateCreateInfo rasterizerStateCI = VkPipelineRasterizationStateCreateInfo.New();

            rasterizerStateCI.cullMode         = VkFormats.VeldridToVkCullMode(cullMode);
            rasterizerStateCI.polygonMode      = VkFormats.VeldridToVkFillMode(fillMode);
            rasterizerStateCI.depthClampEnable = !isDepthClipEnabled; // TODO: Same as OpenGL (?)
            rasterizerStateCI.frontFace        = VkFrontFace.Clockwise;

            RasterizerStateCreateInfo = rasterizerStateCI;
        }