Commit 7f232939 by Jamie Madill Committed by Commit Bot

Run git cl format on several files.

Bug: angleproject:2763 Change-Id: Idcb8a714a6dccdff3dd953679e17a7314866a37d Reviewed-on: https://chromium-review.googlesource.com/1214206 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarFrank Henigman <fjhenigman@chromium.org>
parent 8a561914
......@@ -24,8 +24,8 @@
#include "libANGLE/Error.h"
#include "libANGLE/HandleAllocator.h"
#include "libANGLE/RefCountObject.h"
#include "libANGLE/ResourceMap.h"
#include "libANGLE/ResourceManager.h"
#include "libANGLE/ResourceMap.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/Workarounds.h"
#include "libANGLE/angletypes.h"
......
......@@ -388,7 +388,7 @@ egl::Error Renderer9::initializeDevice()
mBlit = new Blit9(this);
ASSERT(!mVertexDataManager && !mIndexDataManager);
mIndexDataManager = new IndexDataManager(this);
mIndexDataManager = new IndexDataManager(this);
mTranslatedAttribCache.resize(getNativeCaps().maxVertexAttributes);
......@@ -979,7 +979,7 @@ angle::Result Renderer9::setTexture(const gl::Context *context,
gl::Texture *texture)
{
int d3dSamplerOffset = (type == gl::ShaderType::Fragment) ? 0 : D3DVERTEXTEXTURESAMPLER0;
int d3dSampler = index + d3dSamplerOffset;
int d3dSampler = index + d3dSamplerOffset;
IDirect3DBaseTexture9 *d3dTexture = nullptr;
bool forceSetTexture = false;
......
......@@ -334,12 +334,12 @@ gl::Error TextureGL::setSubImageRowByRowWorkaround(const gl::Context *context,
StateManagerGL *stateManager = GetStateManagerGL(context);
gl::PixelUnpackState directUnpack;
directUnpack.alignment = 1;
directUnpack.alignment = 1;
stateManager->setPixelUnpackState(directUnpack);
stateManager->setPixelUnpackBuffer(unpackBuffer);
const gl::InternalFormat &glFormat = gl::GetInternalFormatInfo(format, type);
GLuint rowBytes = 0;
const gl::InternalFormat &glFormat = gl::GetInternalFormatInfo(format, type);
GLuint rowBytes = 0;
ANGLE_TRY_CHECKED_MATH(
glFormat.computeRowPitch(type, area.width, unpack.alignment, unpack.rowLength, &rowBytes));
GLuint imageBytes = 0;
......@@ -395,7 +395,7 @@ gl::Error TextureGL::setSubImagePaddingWorkaround(const gl::Context *context,
StateManagerGL *stateManager = GetStateManagerGL(context);
const gl::InternalFormat &glFormat = gl::GetInternalFormatInfo(format, type);
GLuint rowBytes = 0;
GLuint rowBytes = 0;
ANGLE_TRY_CHECKED_MATH(
glFormat.computeRowPitch(type, area.width, unpack.alignment, unpack.rowLength, &rowBytes));
GLuint imageBytes = 0;
......@@ -410,7 +410,7 @@ gl::Error TextureGL::setSubImagePaddingWorkaround(const gl::Context *context,
stateManager->setPixelUnpackBuffer(unpackBuffer);
gl::PixelUnpackState directUnpack;
directUnpack.alignment = 1;
directUnpack.alignment = 1;
if (useTexImage3D)
{
......@@ -570,7 +570,7 @@ gl::Error TextureGL::copyImage(const gl::Context *context,
gl::TextureTarget target = index.getTarget();
size_t level = static_cast<size_t>(index.getLevelIndex());
GLenum type = GL_NONE;
GLenum type = GL_NONE;
ANGLE_TRY(source->getImplementationColorReadType(context, &type));
nativegl::CopyTexImageImageFormat copyTexImageFormat =
nativegl::GetCopyTexImageImageFormat(functions, workarounds, internalFormat, type);
......@@ -740,9 +740,9 @@ gl::Error TextureGL::copyTexture(const gl::Context *context,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
gl::TextureTarget target = index.getTarget();
size_t level = static_cast<size_t>(index.getLevelIndex());
const TextureGL *sourceGL = GetImplAs<TextureGL>(source);
gl::TextureTarget target = index.getTarget();
size_t level = static_cast<size_t>(index.getLevelIndex());
const TextureGL *sourceGL = GetImplAs<TextureGL>(source);
const gl::ImageDesc &sourceImageDesc =
sourceGL->mState.getImageDesc(NonCubeTextureTypeToTarget(source->getType()), sourceLevel);
gl::Rectangle sourceArea(0, 0, sourceImageDesc.size.width, sourceImageDesc.size.height);
......@@ -789,7 +789,7 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
const FunctionsGL *functions = GetFunctionsGL(context);
BlitGL *blitter = GetBlitGL(context);
TextureGL *sourceGL = GetImplAs<TextureGL>(source);
TextureGL *sourceGL = GetImplAs<TextureGL>(source);
const gl::ImageDesc &sourceImageDesc =
sourceGL->mState.getImageDesc(NonCubeTextureTypeToTarget(source->getType()), sourceLevel);
......@@ -797,7 +797,7 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
ASSERT(sourceGL->getType() == gl::TextureType::_2D);
const LevelInfoGL &sourceLevelInfo =
sourceGL->getLevelInfo(NonCubeTextureTypeToTarget(source->getType()), sourceLevel);
bool needsLumaWorkaround = sourceLevelInfo.lumaWorkaround.enabled;
bool needsLumaWorkaround = sourceLevelInfo.lumaWorkaround.enabled;
GLenum sourceFormat = sourceImageDesc.format.info->format;
bool sourceFormatContainSupersetOfDestFormat =
......@@ -882,8 +882,7 @@ gl::Error TextureGL::setStorage(const gl::Context *context,
for (size_t level = 0; level < levels; level++)
{
gl::Extents levelSize(std::max(size.width >> level, 1),
std::max(size.height >> level, 1),
1);
std::max(size.height >> level, 1), 1);
if (getType() == gl::TextureType::_2D || getType() == gl::TextureType::Rectangle)
{
......@@ -1346,64 +1345,64 @@ void TextureGL::syncTextureStateSwizzle(const FunctionsGL *functions,
{
switch (value)
{
case GL_RED:
case GL_GREEN:
case GL_BLUE:
if (levelInfo.sourceFormat == GL_LUMINANCE ||
levelInfo.sourceFormat == GL_LUMINANCE_ALPHA)
{
// Texture is backed by a RED or RG texture, point all color channels at the red
// channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RED ||
levelInfo.lumaWorkaround.workaroundFormat == GL_RG);
resultSwizzle = GL_RED;
}
else if (levelInfo.sourceFormat == GL_ALPHA)
{
// Color channels are not supposed to exist, make them always sample 0.
resultSwizzle = GL_ZERO;
}
else
{
UNREACHABLE();
}
break;
case GL_RED:
case GL_GREEN:
case GL_BLUE:
if (levelInfo.sourceFormat == GL_LUMINANCE ||
levelInfo.sourceFormat == GL_LUMINANCE_ALPHA)
{
// Texture is backed by a RED or RG texture, point all color channels at the
// red channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RED ||
levelInfo.lumaWorkaround.workaroundFormat == GL_RG);
resultSwizzle = GL_RED;
}
else if (levelInfo.sourceFormat == GL_ALPHA)
{
// Color channels are not supposed to exist, make them always sample 0.
resultSwizzle = GL_ZERO;
}
else
{
UNREACHABLE();
}
break;
case GL_ALPHA:
if (levelInfo.sourceFormat == GL_LUMINANCE)
{
// Alpha channel is not supposed to exist, make it always sample 1.
resultSwizzle = GL_ONE;
}
else if (levelInfo.sourceFormat == GL_ALPHA)
{
// Texture is backed by a RED texture, point the alpha channel at the red
// channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RED);
resultSwizzle = GL_RED;
}
else if (levelInfo.sourceFormat == GL_LUMINANCE_ALPHA)
{
// Texture is backed by an RG texture, point the alpha channel at the green
// channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RG);
resultSwizzle = GL_GREEN;
}
else
{
UNREACHABLE();
}
break;
case GL_ALPHA:
if (levelInfo.sourceFormat == GL_LUMINANCE)
{
// Alpha channel is not supposed to exist, make it always sample 1.
resultSwizzle = GL_ONE;
}
else if (levelInfo.sourceFormat == GL_ALPHA)
{
// Texture is backed by a RED texture, point the alpha channel at the red
// channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RED);
resultSwizzle = GL_RED;
}
else if (levelInfo.sourceFormat == GL_LUMINANCE_ALPHA)
{
// Texture is backed by an RG texture, point the alpha channel at the green
// channel.
ASSERT(levelInfo.lumaWorkaround.workaroundFormat == GL_RG);
resultSwizzle = GL_GREEN;
}
else
{
UNREACHABLE();
}
break;
case GL_ZERO:
case GL_ONE:
// Don't modify the swizzle state when requesting ZERO or ONE.
resultSwizzle = value;
break;
case GL_ZERO:
case GL_ONE:
// Don't modify the swizzle state when requesting ZERO or ONE.
resultSwizzle = value;
break;
default:
UNREACHABLE();
break;
default:
UNREACHABLE();
break;
}
}
else if (levelInfo.depthStencilWorkaround)
......@@ -1441,7 +1440,6 @@ void TextureGL::syncTextureStateSwizzle(const FunctionsGL *functions,
{
UNREACHABLE();
}
}
*outValue = resultSwizzle;
......
......@@ -126,10 +126,10 @@ angle::Result PixelBuffer::stageSubresourceUpdate(ContextVk *contextVk,
VkBuffer bufferHandle = VK_NULL_HANDLE;
uint8_t *stagingPointer = nullptr;
bool newBufferAllocated = false;
uint8_t *stagingPointer = nullptr;
bool newBufferAllocated = false;
VkDeviceSize stagingOffset = 0;
size_t allocationSize = outputDepthPitch * extents.depth;
size_t allocationSize = outputDepthPitch * extents.depth;
ANGLE_TRY(mStagingBuffer.allocate(contextVk, allocationSize, &stagingPointer, &bufferHandle,
&stagingOffset, &newBufferAllocated));
......@@ -197,8 +197,8 @@ angle::Result PixelBuffer::stageSubresourceUpdateFromFramebuffer(
VkBuffer bufferHandle = VK_NULL_HANDLE;
uint8_t *stagingPointer = nullptr;
bool newBufferAllocated = false;
uint8_t *stagingPointer = nullptr;
bool newBufferAllocated = false;
VkDeviceSize stagingOffset = 0;
// The destination is only one layer deep.
......@@ -346,7 +346,7 @@ angle::Result PixelBuffer::stageSubresourceUpdateAndGetData(ContextVk *contextVk
{
VkBuffer bufferHandle;
VkDeviceSize stagingOffset = 0;
bool newBufferAllocated = false;
bool newBufferAllocated = false;
ANGLE_TRY(mStagingBuffer.allocate(contextVk, allocationSize, destData, &bufferHandle,
&stagingOffset, &newBufferAllocated));
......
......@@ -897,8 +897,8 @@ bool ValidImageDataSize(Context *context,
const Extents size(width, height, depth);
const auto &unpack = context->getGLState().getUnpackState();
bool targetIs3D = texType == TextureType::_3D || texType == TextureType::_2DArray;
GLuint endByte = 0;
bool targetIs3D = texType == TextureType::_3D || texType == TextureType::_2DArray;
GLuint endByte = 0;
if (!formatInfo.computePackUnpackEndByte(type, size, unpack, targetIs3D, &endByte))
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), IntegerOverflow);
......@@ -1238,9 +1238,9 @@ bool ValidateBlitFramebufferParameters(Context *context,
return false;
}
const auto &glState = context->getGLState();
Framebuffer *readFramebuffer = glState.getReadFramebuffer();
Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
const auto &glState = context->getGLState();
Framebuffer *readFramebuffer = glState.getReadFramebuffer();
Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
if (!readFramebuffer || !drawFramebuffer)
{
......@@ -1282,8 +1282,8 @@ bool ValidateBlitFramebufferParameters(Context *context,
if (mask & GL_COLOR_BUFFER_BIT)
{
const FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
const Extensions &extensions = context->getExtensions();
const FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
const Extensions &extensions = context->getExtensions();
if (readColorBuffer)
{
......@@ -2568,7 +2568,7 @@ bool ValidateCopyTexImageParametersBase(Context *context,
const char *ValidateDrawStates(Context *context)
{
const Extensions &extensions = context->getExtensions();
const State &state = context->getGLState();
const State &state = context->getGLState();
// WebGL buffers cannot be mapped/unmapped because the MapBufferRange, FlushMappedBufferRange,
// and UnmapBuffer entry points are removed from the WebGL 2.0 API.
......@@ -2696,7 +2696,7 @@ const char *ValidateDrawStates(Context *context)
uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++)
{
const InterfaceBlock &uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex);
GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex);
GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex);
const OffsetBindingPointer<Buffer> &uniformBuffer =
state.getIndexedUniformBuffer(blockBinding);
......@@ -2861,8 +2861,8 @@ bool ValidateDrawArraysCommon(Context *context,
return false;
}
const State &state = context->getGLState();
TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
const State &state = context->getGLState();
TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive() &&
!curTransformFeedback->isPaused())
{
......
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