Commit 502d2e21 by Jamie Madill Committed by Commit Bot

Vulkan: Crunch RenderPassDesc.

This reduces the size of the RenderPass desc from 64 to 12 bytes. Bug: angleproject:2522 Change-Id: Iff2df87ba65be0bd976bba81c76c285cb0fa1ceb Reviewed-on: https://chromium-review.googlesource.com/c/1308459Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarFrank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 2197dc52
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#define LIBANGLE_ANGLETYPES_H_ #define LIBANGLE_ANGLETYPES_H_
#include "common/Color.h" #include "common/Color.h"
#include "common/FixedVector.h"
#include "common/PackedEnums.h" #include "common/PackedEnums.h"
#include "common/bitset_utils.h" #include "common/bitset_utils.h"
#include "common/vector_utils.h" #include "common/vector_utils.h"
...@@ -417,6 +418,9 @@ template <typename T> ...@@ -417,6 +418,9 @@ template <typename T>
using DrawBuffersArray = std::array<T, IMPLEMENTATION_MAX_DRAW_BUFFERS>; using DrawBuffersArray = std::array<T, IMPLEMENTATION_MAX_DRAW_BUFFERS>;
template <typename T> template <typename T>
using DrawBuffersVector = angle::FixedVector<T, IMPLEMENTATION_MAX_DRAW_BUFFERS>;
template <typename T>
using AttribArray = std::array<T, MAX_VERTEX_ATTRIBS>; using AttribArray = std::array<T, MAX_VERTEX_ATTRIBS>;
using ActiveTextureMask = angle::BitSet<IMPLEMENTATION_MAX_ACTIVE_TEXTURES>; using ActiveTextureMask = angle::BitSet<IMPLEMENTATION_MAX_ACTIVE_TEXTURES>;
......
...@@ -789,6 +789,7 @@ const vk::RenderPassDesc &FramebufferVk::getRenderPassDesc() ...@@ -789,6 +789,7 @@ const vk::RenderPassDesc &FramebufferVk::getRenderPassDesc()
} }
vk::RenderPassDesc desc; vk::RenderPassDesc desc;
desc.setSamples(getSamples());
// TODO(jmadill): Support gaps in RenderTargets. http://anglebug.com/2394 // TODO(jmadill): Support gaps in RenderTargets. http://anglebug.com/2394
const auto &colorRenderTargets = mRenderTargetCache.getColors(); const auto &colorRenderTargets = mRenderTargetCache.getColors();
...@@ -796,13 +797,13 @@ const vk::RenderPassDesc &FramebufferVk::getRenderPassDesc() ...@@ -796,13 +797,13 @@ const vk::RenderPassDesc &FramebufferVk::getRenderPassDesc()
{ {
RenderTargetVk *colorRenderTarget = colorRenderTargets[colorIndex]; RenderTargetVk *colorRenderTarget = colorRenderTargets[colorIndex];
ASSERT(colorRenderTarget); ASSERT(colorRenderTarget);
desc.packColorAttachment(colorRenderTarget->getImage()); desc.packAttachment(colorRenderTarget->getImage().getFormat());
} }
RenderTargetVk *depthStencilRenderTarget = mRenderTargetCache.getDepthStencil(); RenderTargetVk *depthStencilRenderTarget = mRenderTargetCache.getDepthStencil();
if (depthStencilRenderTarget) if (depthStencilRenderTarget)
{ {
desc.packDepthStencilAttachment(depthStencilRenderTarget->getImage()); desc.packAttachment(depthStencilRenderTarget->getImage().getFormat());
} }
mRenderPassDesc = desc; mRenderPassDesc = desc;
...@@ -1223,4 +1224,24 @@ const gl::Extents &FramebufferVk::getReadImageExtents() const ...@@ -1223,4 +1224,24 @@ const gl::Extents &FramebufferVk::getReadImageExtents() const
{ {
return getColorReadRenderTarget()->getImageExtents(); return getColorReadRenderTarget()->getImageExtents();
} }
RenderTargetVk *FramebufferVk::getFirstRenderTarget() const
{
for (auto *renderTarget : mRenderTargetCache.getColors())
{
if (renderTarget)
{
return renderTarget;
}
}
return mRenderTargetCache.getDepthStencil();
}
GLint FramebufferVk::getSamples() const
{
RenderTargetVk *firstRT = getFirstRenderTarget();
return firstRT ? firstRT->getImage().getSamples() : 0;
}
} // namespace rx } // namespace rx
...@@ -116,6 +116,9 @@ class FramebufferVk : public FramebufferImpl ...@@ -116,6 +116,9 @@ class FramebufferVk : public FramebufferImpl
angle::Result startNewRenderPass(ContextVk *context, vk::CommandBuffer **commandBufferOut); angle::Result startNewRenderPass(ContextVk *context, vk::CommandBuffer **commandBufferOut);
RenderTargetVk *getFirstRenderTarget() const;
GLint getSamples() const;
private: private:
FramebufferVk(RendererVk *renderer, FramebufferVk(RendererVk *renderer,
const gl::FramebufferState &state, const gl::FramebufferState &state,
......
...@@ -39,7 +39,7 @@ void RenderTargetVk::onColorDraw(vk::FramebufferHelper *framebufferVk, ...@@ -39,7 +39,7 @@ void RenderTargetVk::onColorDraw(vk::FramebufferHelper *framebufferVk,
ASSERT(!mImage->getFormat().textureFormat().hasDepthOrStencilBits()); ASSERT(!mImage->getFormat().textureFormat().hasDepthOrStencilBits());
// Store the attachment info in the renderPassDesc. // Store the attachment info in the renderPassDesc.
renderPassDesc->packColorAttachment(*mImage); renderPassDesc->packAttachment(mImage->getFormat());
// TODO(jmadill): Use automatic layout transition. http://anglebug.com/2361 // TODO(jmadill): Use automatic layout transition. http://anglebug.com/2361
mImage->changeLayoutWithStages(VK_IMAGE_ASPECT_COLOR_BIT, mImage->changeLayoutWithStages(VK_IMAGE_ASPECT_COLOR_BIT,
...@@ -59,7 +59,7 @@ void RenderTargetVk::onDepthStencilDraw(vk::FramebufferHelper *framebufferVk, ...@@ -59,7 +59,7 @@ void RenderTargetVk::onDepthStencilDraw(vk::FramebufferHelper *framebufferVk,
ASSERT(mImage->getFormat().textureFormat().hasDepthOrStencilBits()); ASSERT(mImage->getFormat().textureFormat().hasDepthOrStencilBits());
// Store the attachment info in the renderPassDesc. // Store the attachment info in the renderPassDesc.
renderPassDesc->packDepthStencilAttachment(*mImage); renderPassDesc->packAttachment(mImage->getFormat());
// TODO(jmadill): Use automatic layout transition. http://anglebug.com/2361 // TODO(jmadill): Use automatic layout transition. http://anglebug.com/2361
const angle::Format &format = mImage->getFormat().textureFormat(); const angle::Format &format = mImage->getFormat().textureFormat();
......
...@@ -136,12 +136,14 @@ uint8_t PackGLCompareFunc(GLenum compareFunc) ...@@ -136,12 +136,14 @@ uint8_t PackGLCompareFunc(GLenum compareFunc)
} }
void UnpackAttachmentDesc(VkAttachmentDescription *desc, void UnpackAttachmentDesc(VkAttachmentDescription *desc,
const vk::PackedAttachmentDesc &packedDesc, const vk::Format &format,
uint8_t samples,
const vk::PackedAttachmentOpsDesc &ops) const vk::PackedAttachmentOpsDesc &ops)
{ {
desc->flags = static_cast<VkAttachmentDescriptionFlags>(packedDesc.flags); // We would only need this flag for duplicated attachments. Apply it conservatively.
desc->format = static_cast<VkFormat>(packedDesc.format); desc->flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT;
desc->samples = gl_vk::GetSamples(packedDesc.samples); desc->format = format.vkTextureFormat;
desc->samples = gl_vk::GetSamples(samples);
desc->loadOp = static_cast<VkAttachmentLoadOp>(ops.loadOp); desc->loadOp = static_cast<VkAttachmentLoadOp>(ops.loadOp);
desc->storeOp = static_cast<VkAttachmentStoreOp>(ops.storeOp); desc->storeOp = static_cast<VkAttachmentStoreOp>(ops.storeOp);
desc->stencilLoadOp = static_cast<VkAttachmentLoadOp>(ops.stencilLoadOp); desc->stencilLoadOp = static_cast<VkAttachmentLoadOp>(ops.stencilLoadOp);
...@@ -179,24 +181,35 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context, ...@@ -179,24 +181,35 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context,
const AttachmentOpsArray &ops, const AttachmentOpsArray &ops,
RenderPass *renderPass) RenderPass *renderPass)
{ {
uint32_t attachmentCount = desc.attachmentCount(); size_t attachmentCount = desc.attachmentCount();
ASSERT(attachmentCount > 0);
gl::DrawBuffersArray<VkAttachmentReference> colorAttachmentRefs;
for (uint32_t colorIndex = 0; colorIndex < desc.colorAttachmentCount(); ++colorIndex)
{
VkAttachmentReference &colorRef = colorAttachmentRefs[colorIndex];
colorRef.attachment = colorIndex;
colorRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
}
// Unpack the packed and split representation into the format required by Vulkan.
gl::DrawBuffersVector<VkAttachmentReference> colorAttachmentRefs;
VkAttachmentReference depthStencilAttachmentRef = {}; VkAttachmentReference depthStencilAttachmentRef = {};
if (desc.depthStencilAttachmentCount() > 0) gl::AttachmentArray<VkAttachmentDescription> attachmentDescs;
for (uint32_t attachmentIndex = 0; attachmentIndex < attachmentCount; ++attachmentIndex)
{ {
ASSERT(desc.depthStencilAttachmentCount() == 1); angle::FormatID formatID = desc[attachmentIndex];
depthStencilAttachmentRef.attachment = desc.colorAttachmentCount(); ASSERT(formatID != angle::FormatID::NONE);
depthStencilAttachmentRef.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; const vk::Format &format = context->getRenderer()->getFormat(formatID);
if (!format.angleFormat().hasDepthOrStencilBits())
{
VkAttachmentReference colorRef = colorAttachmentRefs[attachmentIndex];
colorRef.attachment = attachmentIndex;
colorRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
colorAttachmentRefs.push_back(colorRef);
}
else
{
ASSERT(depthStencilAttachmentRef.attachment == 0);
depthStencilAttachmentRef.attachment = attachmentIndex;
depthStencilAttachmentRef.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
}
UnpackAttachmentDesc(&attachmentDescs[attachmentIndex], format, desc.samples(),
ops[attachmentIndex]);
} }
VkSubpassDescription subpassDesc = {}; VkSubpassDescription subpassDesc = {};
...@@ -205,28 +218,14 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context, ...@@ -205,28 +218,14 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context,
subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpassDesc.inputAttachmentCount = 0; subpassDesc.inputAttachmentCount = 0;
subpassDesc.pInputAttachments = nullptr; subpassDesc.pInputAttachments = nullptr;
subpassDesc.colorAttachmentCount = desc.colorAttachmentCount(); subpassDesc.colorAttachmentCount = static_cast<uint32_t>(colorAttachmentRefs.size());
subpassDesc.pColorAttachments = colorAttachmentRefs.data(); subpassDesc.pColorAttachments = colorAttachmentRefs.data();
subpassDesc.pResolveAttachments = nullptr; subpassDesc.pResolveAttachments = nullptr;
subpassDesc.pDepthStencilAttachment = subpassDesc.pDepthStencilAttachment =
(desc.depthStencilAttachmentCount() > 0 ? &depthStencilAttachmentRef : nullptr); (depthStencilAttachmentRef.attachment > 0 ? &depthStencilAttachmentRef : nullptr);
subpassDesc.preserveAttachmentCount = 0; subpassDesc.preserveAttachmentCount = 0;
subpassDesc.pPreserveAttachments = nullptr; subpassDesc.pPreserveAttachments = nullptr;
// Unpack the packed and split representation into the format required by Vulkan.
gl::AttachmentArray<VkAttachmentDescription> attachmentDescs;
for (uint32_t colorIndex = 0; colorIndex < desc.colorAttachmentCount(); ++colorIndex)
{
UnpackAttachmentDesc(&attachmentDescs[colorIndex], desc[colorIndex], ops[colorIndex]);
}
if (desc.depthStencilAttachmentCount() > 0)
{
uint32_t depthStencilIndex = desc.colorAttachmentCount();
UnpackAttachmentDesc(&attachmentDescs[depthStencilIndex], desc[depthStencilIndex],
ops[depthStencilIndex]);
}
VkRenderPassCreateInfo createInfo = {}; VkRenderPassCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; createInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
createInfo.flags = 0; createInfo.flags = 0;
...@@ -246,7 +245,6 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context, ...@@ -246,7 +245,6 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context,
// RenderPassDesc implementation. // RenderPassDesc implementation.
RenderPassDesc::RenderPassDesc() RenderPassDesc::RenderPassDesc()
{ {
ANGLE_UNUSED_VARIABLE(mPadding);
memset(this, 0, sizeof(RenderPassDesc)); memset(this, 0, sizeof(RenderPassDesc));
} }
...@@ -257,30 +255,23 @@ RenderPassDesc::RenderPassDesc(const RenderPassDesc &other) ...@@ -257,30 +255,23 @@ RenderPassDesc::RenderPassDesc(const RenderPassDesc &other)
memcpy(this, &other, sizeof(RenderPassDesc)); memcpy(this, &other, sizeof(RenderPassDesc));
} }
void RenderPassDesc::packAttachment(uint32_t index, const ImageHelper &imageHelper) size_t RenderPassDesc::attachmentCount() const
{ {
PackedAttachmentDesc &desc = mAttachmentDescs[index]; return mAttachmentCount;
// TODO(jmadill): We would only need this flag for duplicated attachments.
desc.flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT;
ASSERT(imageHelper.getSamples() < std::numeric_limits<uint8_t>::max());
desc.samples = static_cast<uint8_t>(imageHelper.getSamples());
const Format &format = imageHelper.getFormat();
ASSERT(format.vkTextureFormat < std::numeric_limits<uint16_t>::max());
desc.format = static_cast<uint16_t>(format.vkTextureFormat);
} }
void RenderPassDesc::packColorAttachment(const ImageHelper &imageHelper) void RenderPassDesc::setSamples(GLint samples)
{ {
ASSERT(mDepthStencilAttachmentCount == 0); ASSERT(samples < std::numeric_limits<uint8_t>::max());
ASSERT(mColorAttachmentCount < gl::IMPLEMENTATION_MAX_DRAW_BUFFERS); mSamples = static_cast<uint8_t>(samples);
packAttachment(mColorAttachmentCount++, imageHelper);
} }
void RenderPassDesc::packDepthStencilAttachment(const ImageHelper &imageHelper) void RenderPassDesc::packAttachment(const Format &format)
{ {
ASSERT(mDepthStencilAttachmentCount == 0); ASSERT(mAttachmentCount < mAttachmentFormats.size() - 1);
packAttachment(mColorAttachmentCount + mDepthStencilAttachmentCount++, imageHelper); static_assert(angle::kNumANGLEFormats < std::numeric_limits<uint8_t>::max(),
"Too many ANGLE formats to fit in uint8_t");
mAttachmentFormats[mAttachmentCount++] = static_cast<uint8_t>(format.angleFormatID);
} }
RenderPassDesc &RenderPassDesc::operator=(const RenderPassDesc &other) RenderPassDesc &RenderPassDesc::operator=(const RenderPassDesc &other)
...@@ -294,27 +285,6 @@ size_t RenderPassDesc::hash() const ...@@ -294,27 +285,6 @@ size_t RenderPassDesc::hash() const
return angle::ComputeGenericHash(*this); return angle::ComputeGenericHash(*this);
} }
uint32_t RenderPassDesc::attachmentCount() const
{
return (mColorAttachmentCount + mDepthStencilAttachmentCount);
}
uint32_t RenderPassDesc::colorAttachmentCount() const
{
return mColorAttachmentCount;
}
uint32_t RenderPassDesc::depthStencilAttachmentCount() const
{
return mDepthStencilAttachmentCount;
}
const PackedAttachmentDesc &RenderPassDesc::operator[](size_t index) const
{
ASSERT(index < mAttachmentDescs.size());
return mAttachmentDescs[index];
}
bool operator==(const RenderPassDesc &lhs, const RenderPassDesc &rhs) bool operator==(const RenderPassDesc &lhs, const RenderPassDesc &rhs)
{ {
return (memcmp(&lhs, &rhs, sizeof(RenderPassDesc)) == 0); return (memcmp(&lhs, &rhs, sizeof(RenderPassDesc)) == 0);
...@@ -334,6 +304,7 @@ void PipelineDesc::operator delete(void *ptr) ...@@ -334,6 +304,7 @@ void PipelineDesc::operator delete(void *ptr)
PipelineDesc::PipelineDesc() PipelineDesc::PipelineDesc()
{ {
ANGLE_UNUSED_VARIABLE(mPadding);
memset(this, 0, sizeof(PipelineDesc)); memset(this, 0, sizeof(PipelineDesc));
} }
...@@ -1038,19 +1009,24 @@ angle::Result RenderPassCache::getCompatibleRenderPass(vk::Context *context, ...@@ -1038,19 +1009,24 @@ angle::Result RenderPassCache::getCompatibleRenderPass(vk::Context *context,
} }
// Insert some dummy attachment ops. // Insert some dummy attachment ops.
// TODO(jmadill): Pre-populate the cache in the Renderer so we rarely miss here. // It would be nice to pre-populate the cache in the Renderer so we rarely miss here.
vk::AttachmentOpsArray ops; vk::AttachmentOpsArray ops;
for (uint32_t colorIndex = 0; colorIndex < desc.colorAttachmentCount(); ++colorIndex)
{
ops.initDummyOp(colorIndex, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
}
if (desc.depthStencilAttachmentCount() > 0) for (uint32_t attachmentIndex = 0; attachmentIndex < desc.attachmentCount(); ++attachmentIndex)
{ {
ops.initDummyOp(desc.colorAttachmentCount(), angle::FormatID formatID = desc[attachmentIndex];
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, ASSERT(formatID != angle::FormatID::NONE);
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); const vk::Format &format = context->getRenderer()->getFormat(formatID);
if (!format.angleFormat().hasDepthOrStencilBits())
{
ops.initDummyOp(attachmentIndex, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
}
else
{
ops.initDummyOp(attachmentIndex, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
}
} }
return getRenderPassWithOps(context, serial, desc, ops, renderPassOut); return getRenderPassWithOps(context, serial, desc, ops, renderPassOut);
......
...@@ -48,16 +48,7 @@ using SharedPipelineLayout = RefCounted<PipelineLayout>; ...@@ -48,16 +48,7 @@ using SharedPipelineLayout = RefCounted<PipelineLayout>;
// Enable struct padding warnings for the code below since it is used in caches. // Enable struct padding warnings for the code below since it is used in caches.
ANGLE_ENABLE_STRUCT_PADDING_WARNINGS ANGLE_ENABLE_STRUCT_PADDING_WARNINGS
struct alignas(4) PackedAttachmentDesc class alignas(4) RenderPassDesc final
{
uint8_t flags;
uint8_t samples;
uint16_t format;
};
static_assert(sizeof(PackedAttachmentDesc) == 4, "Size check failed");
class RenderPassDesc final
{ {
public: public:
RenderPassDesc(); RenderPassDesc();
...@@ -65,29 +56,31 @@ class RenderPassDesc final ...@@ -65,29 +56,31 @@ class RenderPassDesc final
RenderPassDesc(const RenderPassDesc &other); RenderPassDesc(const RenderPassDesc &other);
RenderPassDesc &operator=(const RenderPassDesc &other); RenderPassDesc &operator=(const RenderPassDesc &other);
// Depth stencil attachments must be packed after color attachments. void packAttachment(const Format &format);
void packColorAttachment(const ImageHelper &imageHelper);
void packDepthStencilAttachment(const ImageHelper &imageHelper);
size_t hash() const; size_t hash() const;
uint32_t attachmentCount() const; size_t attachmentCount() const;
uint32_t colorAttachmentCount() const;
uint32_t depthStencilAttachmentCount() const;
const PackedAttachmentDesc &operator[](size_t index) const;
private: void setSamples(GLint samples);
void packAttachment(uint32_t index, const ImageHelper &imageHelper);
uint8_t samples() const { return mSamples; }
uint32_t mColorAttachmentCount; angle::FormatID operator[](size_t index) const
uint32_t mDepthStencilAttachmentCount; {
gl::AttachmentArray<PackedAttachmentDesc> mAttachmentDescs; ASSERT(index < mAttachmentFormats.size());
uint32_t mPadding[4]; return static_cast<angle::FormatID>(mAttachmentFormats[index]);
}
private:
uint8_t mSamples;
uint8_t mAttachmentCount;
gl::AttachmentArray<uint8_t> mAttachmentFormats;
}; };
bool operator==(const RenderPassDesc &lhs, const RenderPassDesc &rhs); bool operator==(const RenderPassDesc &lhs, const RenderPassDesc &rhs);
static_assert(sizeof(RenderPassDesc) == 64, "Size check failed"); static_assert(sizeof(RenderPassDesc) == 12, "Size check failed");
struct alignas(8) PackedAttachmentOpsDesc final struct alignas(8) PackedAttachmentOpsDesc final
{ {
...@@ -358,6 +351,7 @@ class PipelineDesc final ...@@ -358,6 +351,7 @@ class PipelineDesc final
// TODO(jmadill): Dynamic state. // TODO(jmadill): Dynamic state.
// TODO(jmadill): Pipeline layout // TODO(jmadill): Pipeline layout
RenderPassDesc mRenderPassDesc; RenderPassDesc mRenderPassDesc;
uint8_t mPadding[20];
}; };
// Verify the packed pipeline description has no gaps in the packing. // Verify the packed pipeline description has no gaps in the packing.
...@@ -369,9 +363,10 @@ constexpr size_t kPipelineDescSumOfSizes = ...@@ -369,9 +363,10 @@ constexpr size_t kPipelineDescSumOfSizes =
sizeof(PackedInputAssemblyInfo) + sizeof(VkViewport) + sizeof(VkRect2D) + sizeof(PackedInputAssemblyInfo) + sizeof(VkViewport) + sizeof(VkRect2D) +
sizeof(PackedRasterizationStateInfo) + sizeof(PackedMultisampleStateInfo) + sizeof(PackedRasterizationStateInfo) + sizeof(PackedMultisampleStateInfo) +
sizeof(PackedDepthStencilStateInfo) + sizeof(PackedColorBlendStateInfo) + sizeof(PackedDepthStencilStateInfo) + sizeof(PackedColorBlendStateInfo) +
sizeof(RenderPassDesc); sizeof(RenderPassDesc) + 20;
static_assert(sizeof(PipelineDesc) == kPipelineDescSumOfSizes, "Size mismatch"); static constexpr size_t kPipelineDescSize = sizeof(PipelineDesc);
static_assert(kPipelineDescSize == kPipelineDescSumOfSizes, "Size mismatch");
constexpr uint32_t kMaxDescriptorSetLayoutBindings = gl::IMPLEMENTATION_MAX_ACTIVE_TEXTURES; constexpr uint32_t kMaxDescriptorSetLayoutBindings = gl::IMPLEMENTATION_MAX_ACTIVE_TEXTURES;
......
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