Commit 2f612290 by Jamie Madill

Combine widen and defaultBits params of copyVertexData.

Since we never, and never will use a default value of zero for the alpha channel, we can use a value of zero to indicate no widening. This has the benefit of not needing a default value where it does not apply. BUG=angle:550 Change-Id: Ifdfedcb16039aa1d7f8ee644b65c6b4d89f9a384 Reviewed-on: https://chromium-review.googlesource.com/188432Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 0027fa9f
......@@ -11,11 +11,14 @@
#include "common/mathutil.h"
template <typename T, unsigned int componentCount, bool widen, unsigned int defaultValueBits>
// 'widenDefaultValueBits' gives the default value for the alpha channel (4th component)
// the sentinel value 0 means we do not want to widen the input or add an alpha channel
template <typename T, unsigned int componentCount, unsigned int widenDefaultValueBits>
inline void copyVertexData(const void *input, size_t stride, size_t count, void *output)
{
const unsigned int attribSize = sizeof(T) * componentCount;
const T defaultValue = gl::bitCast<T>(defaultValueBits);
const T defaultValue = gl::bitCast<T>(widenDefaultValueBits);
const bool widen = (widenDefaultValueBits != 0);
if (attribSize == stride && !widen)
{
......
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