private static void SetupVulkan() { mainForm = new MainForm(/**/ FormWindowState.Normal /*/FormWindowState.Maximized/**/); VContext.Instance = new VContext(); Context = VContext.Instance; Context.Init(mainForm.Handle); graphicsPipeline = new GenericGraphicsPipeline( new List <ShaderObject>() { new ShaderObject(@"..\..\BaseSampleShader\shader.vert"), new ShaderObject(@"..\..\BaseSampleShader\shader.frag"), } ); Context.InitializeDescriptorPool( 1, new Tuple <uint, DescriptorType>(1, DescriptorType.UniformBuffer) ); SetupUniformMatrices(); commandBuffer = Context.CreateCommandBuffer(); }
public void Render(CommandBuffer commandBuffer, GenericGraphicsPipeline textPipeline) { _meshInputBinding.Bind(commandBuffer); textPipeline.PushConstantManager.SetPushConstant(commandBuffer, "modelMatrix", _modelMatrix); commandBuffer.CmdDraw((uint)_vertexCount, 1, 0, 0); }
public void AnimationShader() { GenericGraphicsPipeline graphicsPipeline = new GenericGraphicsPipeline( new List <ShaderObject>() { new ShaderObject(@"..\..\animationshader.vert"), new ShaderObject(@"..\..\shader.frag"), } ); }
public TextDisplayer() { _textPipeline = new GenericGraphicsPipeline( new List <ShaderObject>() { new EmbeddedShaderObject("VulkanBase.Text.Shader.text.frag"), new EmbeddedShaderObject("VulkanBase.Text.Shader.text.vert") } ); _font = new Font(Properties.Resources.Courier, Properties.Resources.CourierCharacterWidth); _imageWithMemory = TextureLoader.CreateImageWithMemory(_font.Texture); _imageDescriptorSet = _textPipeline.CreateDescriptorSet(0, 0, _imageWithMemory.ImageView); }