| 164 | } |
| 165 | |
| 166 | FramebufferInfoEx::FramebufferInfoEx(const FramebufferDesc& desc) |
| 167 | : FramebufferInfo(desc) |
| 168 | { |
| 169 | if (desc.depthAttachment.valid()) |
| 170 | { |
| 171 | const TextureDesc& textureDesc = desc.depthAttachment.texture->getDesc(); |
| 172 | TextureSubresourceSet const subresources = desc.depthAttachment.subresources.resolve(textureDesc, true); |
| 173 | width = std::max(textureDesc.width >> subresources.baseMipLevel, 1u); |
| 174 | height = std::max(textureDesc.height >> subresources.baseMipLevel, 1u); |
| 175 | arraySize = subresources.numArraySlices; |
| 176 | } |
| 177 | else if (!desc.colorAttachments.empty() && desc.colorAttachments[0].valid()) |
| 178 | { |
| 179 | const TextureDesc& textureDesc = desc.colorAttachments[0].texture->getDesc(); |
| 180 | TextureSubresourceSet const subresources = desc.colorAttachments[0].subresources.resolve(textureDesc, true); |
| 181 | width = std::max(textureDesc.width >> subresources.baseMipLevel, 1u); |
| 182 | height = std::max(textureDesc.height >> subresources.baseMipLevel, 1u); |
| 183 | arraySize = subresources.numArraySlices; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | void ICommandList::setResourceStatesForFramebuffer(IFramebuffer* framebuffer) |
| 188 | { |