Commit 8aee6546 by Jamie Madill Committed by Commit Bot

FramebufferAttachment: Cast pointers directly.

Instead of using a temporary pointer-to-pointer, try casting the pointer-to-pointer type directly. This will facilitate Vulkan's use of RenderTargets. BUG=angleproject:1319 Change-Id: I0a14762e8e442b9eaa6eba3fdf653aef3c362533 Reviewed-on: https://chromium-review.googlesource.com/424148Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 4d0bf557
......@@ -131,11 +131,9 @@ class FramebufferAttachment final
template <typename T>
gl::Error getRenderTarget(T **rtOut) const
{
// Cast through the pointer-to-pointer type
rx::FramebufferAttachmentRenderTarget *rtPtr = nullptr;
gl::Error error = getRenderTarget(&rtPtr);
*rtOut = static_cast<T*>(rtPtr);
return error;
static_assert(std::is_base_of<rx::FramebufferAttachmentRenderTarget, T>(),
"Invalid RenderTarget class.");
return getRenderTarget(reinterpret_cast<rx::FramebufferAttachmentRenderTarget **>(rtOut));
}
bool operator==(const FramebufferAttachment &other) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment