| 310 | } |
| 311 | |
| 312 | ref<RenderTargetView> Fbo::getRenderTargetView(uint32_t rtIndex) const |
| 313 | { |
| 314 | auto& rt = mColorAttachments[rtIndex]; |
| 315 | if (rt.pTexture) |
| 316 | { |
| 317 | return rt.pTexture->getRTV(rt.mipLevel, rt.firstArraySlice, rt.arraySize); |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | if (!rt.pNullView) |
| 322 | { |
| 323 | // TODO: mColorAttachments doesn't contain enough information to fully determine the view dimension. Assume 2D for now. |
| 324 | auto dimension = rt.arraySize > 1 ? RenderTargetView::Dimension::Texture2DArray : RenderTargetView::Dimension::Texture2D; |
| 325 | rt.pNullView = RenderTargetView::create(mpDevice, dimension); |
| 326 | } |
| 327 | return static_ref_cast<RenderTargetView>(rt.pNullView); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | ref<DepthStencilView> Fbo::getDepthStencilView() const |
| 332 | { |