| 50 | }; |
| 51 | |
| 52 | BoundBoxRenderer::BoundBoxRenderer(const CreateInfo& CI) : |
| 53 | m_pDevice{CI.pDevice}, |
| 54 | m_pStateCache{CI.pStateCache}, |
| 55 | m_pCameraAttribsCB{CI.pCameraAttribsCB}, |
| 56 | m_RTVFormats{CI.RTVFormats, CI.RTVFormats + CI.NumRenderTargets}, |
| 57 | m_DSVFormat{CI.DSVFormat}, |
| 58 | m_PSMainSource{CI.PSMainSource != nullptr ? CI.PSMainSource : ""}, |
| 59 | m_PackMatrixRowMajor{CI.PackMatrixRowMajor}, |
| 60 | m_AsyncShaders{CI.AsyncShaders} |
| 61 | { |
| 62 | DEV_CHECK_ERR(m_pDevice != nullptr, "Device must not be null"); |
| 63 | DEV_CHECK_ERR(m_pCameraAttribsCB != nullptr, "Camera Attribs CB must not be null"); |
| 64 | |
| 65 | const RenderDeviceInfo& DeviceInfo = m_pDevice->GetDeviceInfo(); |
| 66 | |
| 67 | USAGE Usage = (DeviceInfo.IsGLDevice() || DeviceInfo.Type == RENDER_DEVICE_TYPE_D3D11) ? |
| 68 | USAGE_DEFAULT : |
| 69 | USAGE_DYNAMIC; |
| 70 | if (Usage == USAGE_DEFAULT) |
| 71 | { |
| 72 | m_ShaderAttribs = std::make_unique<BoundBoxShaderAttribs>(); |
| 73 | } |
| 74 | |
| 75 | CreateUniformBuffer(m_pDevice, sizeof(BoundBoxShaderAttribs), "Bound Box Attribs CB", |
| 76 | &m_RenderAttribsCB, Usage, BIND_UNIFORM_BUFFER, |
| 77 | Usage == USAGE_DEFAULT ? CPU_ACCESS_NONE : CPU_ACCESS_WRITE, |
| 78 | Usage == USAGE_DEFAULT ? m_ShaderAttribs.get() : nullptr); |
| 79 | VERIFY_EXPR(m_RenderAttribsCB != nullptr); |
| 80 | } |
| 81 | |
| 82 | BoundBoxRenderer::~BoundBoxRenderer() |
| 83 | { |
nothing calls this directly
no outgoing calls
no test coverage detected