| 96 | } |
| 97 | |
| 98 | void IMaterial::BindParameters::BindDrawData() |
| 99 | { |
| 100 | // Write draw call to the object buffer |
| 101 | ASSERT(DrawCall); |
| 102 | auto& objectBuffer = RenderContext.List->TempObjectBuffer; |
| 103 | objectBuffer.Clear(); |
| 104 | ShaderObjectData objData; |
| 105 | objData.Store(*DrawCall); |
| 106 | objectBuffer.Write(objData); |
| 107 | objectBuffer.Flush(GPUContext); |
| 108 | ObjectBuffer = objectBuffer.GetBuffer()->View(); |
| 109 | |
| 110 | // Setup data |
| 111 | MaterialShaderDataPerDraw perDraw; |
| 112 | perDraw.DrawPadding = Float3::Zero; |
| 113 | perDraw.DrawObjectIndex = 0; |
| 114 | |
| 115 | // Update constants |
| 116 | GPUContext->UpdateCB(PerDrawConstants, &perDraw); |
| 117 | GPUContext->BindCB(2, PerDrawConstants); |
| 118 | } |
| 119 | |
| 120 | GPUPipelineState* MaterialShader::PipelineStateCache::InitPS(CullMode mode, bool wireframe) |
| 121 | { |