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