| 1439 | } |
| 1440 | |
| 1441 | std::string PBR_Renderer::GetVSOutputStruct(PSO_FLAGS PSOFlags, bool UseVkPointSize, bool UsePrimitiveId) |
| 1442 | { |
| 1443 | // struct VSOutput |
| 1444 | // { |
| 1445 | // float4 ClipPos : SV_Position; |
| 1446 | // float3 WorldPos : WORLD_POS; |
| 1447 | // float4 Color : COLOR; |
| 1448 | // float3 Normal : NORMAL; |
| 1449 | // float2 UV0 : UV0; |
| 1450 | // float2 UV1 : UV1; |
| 1451 | // float3 Tangent : TANGENT; |
| 1452 | // float4 PrevClipPos : PREV_CLIP_POS; |
| 1453 | // }; |
| 1454 | |
| 1455 | std::stringstream ss; |
| 1456 | ss << "struct VSOutput" << std::endl |
| 1457 | << "{" << std::endl |
| 1458 | << " float4 ClipPos : SV_Position;" << std::endl |
| 1459 | << " float3 WorldPos : WORLD_POS;" << std::endl; |
| 1460 | if (PSOFlags & PSO_FLAG_USE_VERTEX_COLORS) |
| 1461 | { |
| 1462 | ss << " float4 Color : COLOR;" << std::endl; |
| 1463 | } |
| 1464 | if (PSOFlags & PSO_FLAG_USE_VERTEX_NORMALS) |
| 1465 | { |
| 1466 | ss << " float3 Normal : NORMAL;" << std::endl; |
| 1467 | } |
| 1468 | if (PSOFlags & PSO_FLAG_USE_TEXCOORD0) |
| 1469 | { |
| 1470 | ss << " float2 UV0 : UV0;" << std::endl; |
| 1471 | } |
| 1472 | if (PSOFlags & PSO_FLAG_USE_TEXCOORD1) |
| 1473 | { |
| 1474 | ss << " float2 UV1 : UV1;" << std::endl; |
| 1475 | } |
| 1476 | if (PSOFlags & PSO_FLAG_USE_VERTEX_TANGENTS) |
| 1477 | { |
| 1478 | ss << " float3 Tangent : TANGENT;" << std::endl; |
| 1479 | } |
| 1480 | if (PSOFlags & PSO_FLAG_COMPUTE_MOTION_VECTORS) |
| 1481 | { |
| 1482 | ss << " float4 PrevClipPos : PREV_CLIP_POS;" << std::endl; |
| 1483 | } |
| 1484 | if (UseVkPointSize) |
| 1485 | { |
| 1486 | ss << " [[vk::builtin(\"PointSize\")]] float PointSize : PSIZE;" << std::endl; |
| 1487 | } |
| 1488 | if (UsePrimitiveId) |
| 1489 | { |
| 1490 | ss << " int PrimitiveID : PRIM_ID;" << std::endl; |
| 1491 | } |
| 1492 | ss << "};" << std::endl; |
| 1493 | return ss.str(); |
| 1494 | } |
| 1495 | |
| 1496 | std::string PBR_Renderer::GetPSOutputStruct(PSO_FLAGS PSOFlags) |
| 1497 | { |
nothing calls this directly
no outgoing calls
no test coverage detected