comparison semiconginev2/rendering/shaders.nim @ 1257:e9b8d87b9883

fix: super stupid bug in perspective matrix X(
author sam <sam@basx.dev>
date Sun, 28 Jul 2024 18:55:46 +0700
parents c4f98eb4bb05
children
comparison
equal deleted inserted replaced
1256:bfb75c934f4e 1257:e9b8d87b9883
362 topology: VkPrimitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 362 topology: VkPrimitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
363 polygonMode: VkPolygonMode = VK_POLYGON_MODE_FILL, 363 polygonMode: VkPolygonMode = VK_POLYGON_MODE_FILL,
364 cullMode: openArray[VkCullModeFlagBits] = [VK_CULL_MODE_BACK_BIT], 364 cullMode: openArray[VkCullModeFlagBits] = [VK_CULL_MODE_BACK_BIT],
365 frontFace: VkFrontFace = VK_FRONT_FACE_CLOCKWISE, 365 frontFace: VkFrontFace = VK_FRONT_FACE_CLOCKWISE,
366 lineWidth = 1'f32, 366 lineWidth = 1'f32,
367 depthClampEnable = false,
367 ): Pipeline[TShader] = 368 ): Pipeline[TShader] =
368 # create pipeline 369 # create pipeline
369 370
370 const shader = default(TShader) 371 const shader = default(TShader)
371 (result.vertexShaderModule, result.fragmentShaderModule) = CompileShader(shader) 372 (result.vertexShaderModule, result.fragmentShaderModule) = CompileShader(shader)
443 viewportCount: 1, 444 viewportCount: 1,
444 scissorCount: 1, 445 scissorCount: 1,
445 ) 446 )
446 rasterizer = VkPipelineRasterizationStateCreateInfo( 447 rasterizer = VkPipelineRasterizationStateCreateInfo(
447 sType: VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, 448 sType: VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
448 depthClampEnable: VK_FALSE, 449 depthClampEnable: depthClampEnable,
449 rasterizerDiscardEnable: VK_FALSE, 450 rasterizerDiscardEnable: VK_FALSE,
450 polygonMode: polygonMode, 451 polygonMode: polygonMode,
451 lineWidth: lineWidth, 452 lineWidth: lineWidth,
452 cullMode: toBits cullMode, 453 cullMode: toBits cullMode,
453 frontFace: frontFace, 454 frontFace: frontFace,