1Reference Renderer Design Notes 2------------------------------- 3 4Requirements: 5 - must support arbitrary VA arrays 6 - must support primitive setup reference 7 - must support lines, points 8 - must support instancing 9 - must support vertex shading -> custom position transformations 10 - flat, noperspective shading 11 - multiple render targets 12 - faster shading? move packet loop inside shader 13 (helper class can make shader implementation easier) 14 - can be extended for tessellation and geometry shading 15 16Integrate with: 17 - sglr 18 - random shader generator 19 20Uniforms: 21 - shader objects can contain parameters, renderer doesn't care about them 22 - can contain simple data or references to resources (textures for example) 23 24Pipeline: 25 26Vertex cache: 27 - based on indices setup transformed vertex buffer 28 - in: 29 + index list 30 + VS generic output count 31 - out: 32 + VS execution queue 33 + index remap information? 34 - trivial implementation: 35 + run VS for all vertices at once 36 37VertexShader: 38 - provides position & point size 39 - transforms other vertices 40 - in: 41 + VertexAttrib array 42 + packet list: 43 + VertexID, InstanceID (pack into some accessor?) 44 + uniform ptr 45 - out: 46 + position 47 + point size 48 + array of generic transformed attributes (float/int/uint) 49 50Tessellation: 51 - \todo [pyry] Define 52 - replaces primitive assembly? 53 54Primitive assembly: 55 - sets up primitives 56 - gl3: triangles, points, lines (adjecency?) 57 - in: 58 + full primitive type 59 + index list 60 + position & point size from VS 61 - out: 62 + primitive list for rasterization / geometry shading 63 + positions 64 + provoking vertex for flatshading 65 66GeometryShader: 67 - in: 68 + primitive list 69 - out: 70 + changed primitive list 71 72Coordinate transform: 73 - in: 74 + primitive list 75 - out: 76 + coordinates after viewport transform 77 + z-clipping bits 78 79Rasterizer: 80 - pretty much as it is currently 81 82FragmentShader: 83 - in: 84 + packet list: 85 + base coordinates 86 + barycentrics, both perspective and non-perspective 87 + generic attribute accessor (2 or 3 vertices) 88 + provoking vertex index 89 + uniform ptr 90 - out: 91 + shaded packet list: 92 + colors per render target 93 + modified live mask - for discard 94 - utils: 95 + compute derivatives from data in SoA form 96 + compute lod for texturing 97