mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Added render target queries for framebuffers
This commit is contained in:
parent
9fa6592b7d
commit
60992143b1
@ -53,6 +53,26 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32_t DxvkRenderTargets::getAttachmentId(
|
||||||
|
const Rc<DxvkImageView>& view) const {
|
||||||
|
if (view == nullptr)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (m_depthTarget == view)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint32_t colorAttachmentBaseId =
|
||||||
|
m_depthTarget == nullptr ? 0 : 1;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
|
if (m_colorTargets.at(i) == view)
|
||||||
|
return i + colorAttachmentBaseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkFramebufferSize DxvkRenderTargets::renderTargetSize(
|
DxvkFramebufferSize DxvkRenderTargets::renderTargetSize(
|
||||||
const Rc<DxvkImageView>& renderTarget) const {
|
const Rc<DxvkImageView>& renderTarget) const {
|
||||||
auto extent = renderTarget->image()->info().extent;
|
auto extent = renderTarget->image()->info().extent;
|
||||||
|
@ -94,6 +94,18 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
DxvkFramebufferSize getImageSize() const;
|
DxvkFramebufferSize getImageSize() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieves the ID of an attachment
|
||||||
|
*
|
||||||
|
* This can be used to locate a color attachment
|
||||||
|
* or the depth-stencil attachment. Returns -1
|
||||||
|
* if the given view is not an attachment.
|
||||||
|
* \param [in] view View to find
|
||||||
|
* \returns Attachment ID, or \c -1
|
||||||
|
*/
|
||||||
|
int32_t getAttachmentId(
|
||||||
|
const Rc<DxvkImageView>& view) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::array<Rc<DxvkImageView>, MaxNumRenderTargets> m_colorTargets;
|
std::array<Rc<DxvkImageView>, MaxNumRenderTargets> m_colorTargets;
|
||||||
@ -147,6 +159,14 @@ namespace dxvk {
|
|||||||
return m_framebufferSize;
|
return m_framebufferSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Render target info
|
||||||
|
* \returns Render target info
|
||||||
|
*/
|
||||||
|
const DxvkRenderTargets& renderTargets() const {
|
||||||
|
return m_renderTargets;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Rc<vk::DeviceFn> m_vkd;
|
Rc<vk::DeviceFn> m_vkd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user