Atlas - VULKAN_VertexShader.hlsl

Home / ext / SDL / src / render / vulkan Lines: 1 | Size: 1056 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1#pragma pack_matrix( row_major ) 2 3struct VertexShaderConstants 4{ 5 matrix model; 6 matrix projectionAndView; 7}; 8[[vk::push_constant]] 9ConstantBuffer<VertexShaderConstants> pushConstants; 10 11struct VertexShaderInput 12{ 13 float3 pos : POSITION; 14 float2 tex : TEXCOORD0; 15 float4 color : COLOR0; 16}; 17 18struct VertexShaderOutput 19{ 20 float4 pos : SV_POSITION; 21 float2 tex : TEXCOORD0; 22 float4 color : COLOR0; 23 [[vk::builtin("PointSize")]] float pointSize : SV_PointSize; 24}; 25 26VertexShaderOutput mainColor(VertexShaderInput input) 27{ 28 VertexShaderOutput output; 29 float4 pos = float4(input.pos, 1.0f); 30 31 // Transform the vertex position into projected space. 32 pos = mul(pos, pushConstants.model); 33 pos = mul(pos, pushConstants.projectionAndView); 34 output.pos = pos; 35 36 // Pass through texture coordinates and color values without transformation 37 output.tex = input.tex; 38 output.color = input.color; 39 40 // Always output pointSize so that this VS can be used with points 41 output.pointSize = 1.0; 42 43 return output; 44} 45 46
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.