Commit e4634a13 by Jamie Madill Committed by Commit Bot

Apply code formatting.

Several files were formatted by the code generation script. Bug: angleproject:2957 Change-Id: I8a5cbf2c17297a3644686004a8981ab2305c1ada Reviewed-on: https://chromium-review.googlesource.com/c/1334428Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent b56ddbb7
......@@ -262,4 +262,4 @@ class ANGLE_NO_DISCARD Result
#include "Error.inl"
#endif // LIBANGLE_ERROR_H_
#endif // LIBANGLE_ERROR_H_
......@@ -165,7 +165,7 @@ GLuint ShaderProgramManager::createShader(rx::GLImplFactory *factory,
ShaderType type)
{
ASSERT(type != ShaderType::InvalidEnum);
GLuint handle = mHandleAllocator.allocate();
GLuint handle = mHandleAllocator.allocate();
mShaders.assign(handle, new Shader(this, factory, rendererLimitations, type, handle));
return handle;
}
......@@ -364,7 +364,7 @@ angle::Result PathManager::createPaths(Context *context, GLsizei range, GLuint *
for (GLsizei i = 0; i < range; ++i)
{
rx::PathImpl *impl = paths[static_cast<unsigned>(i)];
const auto id = client + i;
const auto id = client + i;
mPaths.assign(id, new Path(impl));
}
*createdOut = client;
......
......@@ -306,4 +306,4 @@ class ProgramPipelineManager
} // namespace gl
#endif // LIBANGLE_RESOURCEMANAGER_H_
#endif // LIBANGLE_RESOURCEMANAGER_H_
......@@ -173,7 +173,6 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
protected:
const gl::TextureState &mState;
};
}
#endif // LIBANGLE_RENDERER_TEXTUREIMPL_H_
#endif // LIBANGLE_RENDERER_TEXTUREIMPL_H_
......@@ -126,7 +126,6 @@ class MockTextureImpl : public TextureImpl
protected:
gl::TextureState mMockState;
};
}
#endif // LIBANGLE_RENDERER_TEXTUREIMPLMOCK_H_
#endif // LIBANGLE_RENDERER_TEXTUREIMPLMOCK_H_
......@@ -185,11 +185,11 @@ angle::Result FramebufferD3D::clearBufferfi(const gl::Context *context,
GLint stencil)
{
// glClearBufferfi can only be called to clear a depth stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
clearParams.clearDepth = true;
clearParams.depthValue = depth;
clearParams.clearStencil = true;
clearParams.stencilValue = stencil;
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
clearParams.clearDepth = true;
clearParams.depthValue = depth;
clearParams.clearStencil = true;
clearParams.stencilValue = stencil;
return clearImpl(context, clearParams);
}
......@@ -304,7 +304,8 @@ bool FramebufferD3D::checkStatus(const gl::Context *context) const
// D3D11 does not allow for overlapping RenderTargetViews.
// If WebGL compatibility is enabled, this has already been checked at a higher level.
ASSERT(!context->getExtensions().webglCompatibility || mState.colorAttachmentsAreUniqueImages());
ASSERT(!context->getExtensions().webglCompatibility ||
mState.colorAttachmentsAreUniqueImages());
if (!context->getExtensions().webglCompatibility)
{
if (!mState.colorAttachmentsAreUniqueImages())
......@@ -418,7 +419,7 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const gl:
}
}
mColorAttachmentsForRender = std::move(colorAttachmentsForRender);
mColorAttachmentsForRender = std::move(colorAttachmentsForRender);
mCurrentActiveProgramOutputs = activeProgramOutputs;
return mColorAttachmentsForRender.value();
......
......@@ -43,7 +43,7 @@ class TextureD3D : public TextureImpl
void resetDirty() { mDirtyImages = false; }
virtual ImageD3D *getImage(const gl::ImageIndex &index) const = 0;
virtual GLsizei getLayerCount(int level) const = 0;
virtual GLsizei getLayerCount(int level) const = 0;
angle::Result getImageAndSyncFromStorage(const gl::Context *context,
const gl::ImageIndex &index,
......@@ -78,7 +78,7 @@ class TextureD3D : public TextureImpl
// Returns an ImageIndex for a particular "Image". 3D Textures do not have images for
// slices of their depth texures, so 3D textures ignore the layer parameter.
virtual gl::ImageIndex getImageIndex(GLint mip, GLint layer) const = 0;
virtual bool isValidIndex(const gl::ImageIndex &index) const = 0;
virtual bool isValidIndex(const gl::ImageIndex &index) const = 0;
angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type,
......@@ -703,8 +703,9 @@ class TextureD3D_2DArray : public TextureD3D
// Storing images as an array of single depth textures since D3D11 treats each array level of a
// Texture2D object as a separate subresource. Each layer would have to be looped over
// to update all the texture layers since they cannot all be updated at once and it makes the most
// sense for the Image class to not have to worry about layer subresource as well as mip subresources.
// to update all the texture layers since they cannot all be updated at once and it makes the
// most sense for the Image class to not have to worry about layer subresource as well as mip
// subresources.
GLsizei mLayerCounts[gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS];
ImageD3D **mImageArray[gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS];
};
......@@ -896,4 +897,4 @@ class TextureD3D_2DMultisampleArray : public TextureD3DImmutableBase
};
}
#endif // LIBANGLE_RENDERER_D3D_TEXTURED3D_H_
#endif // LIBANGLE_RENDERER_D3D_TEXTURED3D_H_
......@@ -130,7 +130,7 @@ class Buffer11::BufferStorage : angle::NonCopyable
size_t length,
GLbitfield access,
uint8_t **mapPointerOut) = 0;
virtual void unmap() = 0;
virtual void unmap() = 0;
angle::Result setData(const gl::Context *context,
const uint8_t *data,
......@@ -1210,7 +1210,7 @@ angle::Result Buffer11::NativeStorage::map(const gl::Context *context,
ASSERT(isCPUAccessible(access));
D3D11_MAPPED_SUBRESOURCE mappedResource;
D3D11_MAP d3dMapType = gl_d3d11::GetD3DMapTypeFromBits(mUsage, access);
D3D11_MAP d3dMapType = gl_d3d11::GetD3DMapTypeFromBits(mUsage, access);
UINT d3dMapFlag = ((access & GL_MAP_UNSYNCHRONIZED_BIT) != 0 ? D3D11_MAP_FLAG_DO_NOT_WAIT : 0);
ANGLE_TRY(
......
......@@ -628,7 +628,7 @@ angle::Result Clear11::clearFramebuffer(const gl::Context *context,
dsv = depthStencilRenderTarget->getDepthStencilView().get();
ASSERT(dsv != nullptr);
const auto &nativeFormat = depthStencilRenderTarget->getFormatSet().format();
const auto &nativeFormat = depthStencilRenderTarget->getFormatSet().format();
const auto *stencilAttachment = fboData.getStencilAttachment();
uint32_t stencilUnmasked =
......@@ -701,7 +701,7 @@ angle::Result Clear11::clearFramebuffer(const gl::Context *context,
ANGLE_TRY(mRenderer->getBlendState(context, mBlendStateKey, &blendState));
const d3d11::DepthStencilState *dsState = nullptr;
const float *zValue = nullptr;
const float *zValue = nullptr;
if (dsv)
{
......@@ -772,10 +772,10 @@ angle::Result Clear11::clearFramebuffer(const gl::Context *context,
}
// Get Shaders
const d3d11::VertexShader *vs = nullptr;
const d3d11::VertexShader *vs = nullptr;
const d3d11::GeometryShader *gs = nullptr;
const d3d11::InputLayout *il = nullptr;
const d3d11::PixelShader *ps = nullptr;
const d3d11::InputLayout *il = nullptr;
const d3d11::PixelShader *ps = nullptr;
const bool hasLayeredLayout =
(fboData.getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE);
ANGLE_TRY(mShaderManager.getShadersAndLayout(context, mRenderer, clearParams.colorType, numRtvs,
......
......@@ -100,7 +100,7 @@ angle::Result Image11::CopyImage(const gl::Context *context,
gl::GetSizedInternalFormatInfo(sourceFormat.fboImplementationInternalFormat).pixelBytes;
GLenum destUnsizedFormat = gl::GetUnsizedFormat(dest->getInternalFormat());
const auto &destFormat = d3d11::Format::Get(dest->getInternalFormat(), rendererCaps).format();
const auto &destFormat = d3d11::Format::Get(dest->getInternalFormat(), rendererCaps).format();
const auto &destFormatInfo =
gl::GetSizedInternalFormatInfo(destFormat.fboImplementationInternalFormat);
GLuint destPixelBytes = destFormatInfo.pixelBytes;
......@@ -162,7 +162,7 @@ angle::Result Image11::copyToStorage(const gl::Context *context,
}
const TextureHelper11 *stagingTexture = nullptr;
unsigned int stagingSubresourceIndex = 0;
unsigned int stagingSubresourceIndex = 0;
ANGLE_TRY(getStagingTexture(context, &stagingTexture, &stagingSubresourceIndex));
ANGLE_TRY(storage11->updateSubresourceLevel(context, *stagingTexture, stagingSubresourceIndex,
index, region));
......@@ -411,7 +411,7 @@ angle::Result Image11::copyFromFramebuffer(const gl::Context *context,
const auto &destD3D11Format =
d3d11::Format::Get(mInternalFormat, mRenderer->getRenderer11DeviceCaps());
auto loadFunction = destD3D11Format.getLoadFunctions()(destFormatInfo.type);
auto loadFunction = destD3D11Format.getLoadFunctions()(destFormatInfo.type);
angle::Result error = angle::Result::Continue();
if (loadFunction.requiresConversion)
{
......@@ -454,7 +454,7 @@ angle::Result Image11::copyWithoutConversion(const gl::Context *context,
{
// No conversion needed-- use copyback fastpath
const TextureHelper11 *stagingTexture = nullptr;
unsigned int stagingSubresourceIndex = 0;
unsigned int stagingSubresourceIndex = 0;
ANGLE_TRY(getStagingTexture(context, &stagingTexture, &stagingSubresourceIndex));
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
......@@ -634,7 +634,7 @@ angle::Result Image11::map(const gl::Context *context,
ANGLE_TRY(recoverFromAssociatedStorage(context));
const TextureHelper11 *stagingTexture = nullptr;
unsigned int subresourceIndex = 0;
unsigned int subresourceIndex = 0;
ANGLE_TRY(getStagingTexture(context, &stagingTexture, &subresourceIndex));
ASSERT(stagingTexture && stagingTexture->valid());
......
......@@ -1321,9 +1321,9 @@ angle::Result TextureStorage11_2D::createUAVForImage(const gl::Context *context,
{
ASSERT(outUAV);
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;
uavDesc.Texture2D.MipSlice = mTopLevel + level;
uavDesc.Format = format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;
uavDesc.Texture2D.MipSlice = mTopLevel + level;
ANGLE_TRY(
mRenderer->allocateResource(GetImplAs<Context11>(context), uavDesc, texture.get(), outUAV));
outUAV->setDebugName("TexStorage2D.UAVForImage");
......
......@@ -198,12 +198,12 @@ angle::Result Framebuffer9::readPixelsImpl(const gl::Context *context,
gl::FormatType formatType(format, type);
PackPixelsParams packParams;
packParams.area.x = rect.left;
packParams.area.y = rect.top;
packParams.area.width = rect.right - rect.left;
packParams.area.height = rect.bottom - rect.top;
packParams.destFormat = &GetFormatFromFormatType(format, type);
packParams.outputPitch = static_cast<GLuint>(outputPitch);
packParams.area.x = rect.left;
packParams.area.y = rect.top;
packParams.area.width = rect.right - rect.left;
packParams.area.height = rect.bottom - rect.top;
packParams.destFormat = &GetFormatFromFormatType(format, type);
packParams.outputPitch = static_cast<GLuint>(outputPitch);
packParams.reverseRowOrder = pack.reverseRowOrder;
PackPixels(packParams, d3dFormatInfo.info(), inputPitch, source, pixels);
......
......@@ -80,8 +80,9 @@ angle::Result RenderbufferGL::setStorageMultisample(const gl::Context *context,
const gl::TextureCaps &formatCaps = mTextureCaps.get(internalformat);
if (samples > formatCaps.getMaxSamples())
{
// Before version 4.2, it is unknown if the specific internal format can support the requested number
// of samples. It is expected that GL_OUT_OF_MEMORY is returned if the renderbuffer cannot be created.
// Before version 4.2, it is unknown if the specific internal format can support the
// requested number of samples. It is expected that GL_OUT_OF_MEMORY is returned if the
// renderbuffer cannot be created.
GLenum error = GL_NO_ERROR;
do
{
......
......@@ -9,9 +9,9 @@
#ifndef LIBANGLE_RENDERER_GL_TEXTUREGL_H_
#define LIBANGLE_RENDERER_GL_TEXTUREGL_H_
#include "libANGLE/Texture.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/renderer/TextureImpl.h"
#include "libANGLE/Texture.h"
namespace rx
{
......@@ -246,7 +246,6 @@ class TextureGL : public TextureImpl
GLuint mTextureID;
};
}
#endif // LIBANGLE_RENDERER_GL_TEXTUREGL_H_
#endif // LIBANGLE_RENDERER_GL_TEXTUREGL_H_
......@@ -86,7 +86,7 @@ VertexArrayGL::~VertexArrayGL()
void VertexArrayGL::destroy(const gl::Context *context)
{
mStateManager->deleteVertexArray(mVertexArrayID);
mVertexArrayID = 0;
mVertexArrayID = 0;
mAppliedNumViews = 1;
mStateManager->deleteBuffer(mStreamingElementArrayBuffer);
......@@ -276,7 +276,7 @@ void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &att
// If streaming is going to be required, compute the size of the required buffer
// and how much slack space at the beginning of the buffer will be required by determining
// the attribute with the largest data size.
size_t typeSize = ComputeVertexAttributeTypeSize(attrib);
size_t typeSize = ComputeVertexAttributeTypeSize(attrib);
GLuint adjustedDivisor = GetAdjustedDivisor(mAppliedNumViews, binding.getDivisor());
*outStreamingDataSize +=
typeSize * ComputeVertexBindingElementCount(adjustedDivisor, indexRange.vertexCount(),
......@@ -338,7 +338,7 @@ angle::Result VertexArrayGL::streamAttributes(const gl::Context *context,
for (auto idx : attribsToStream)
{
const auto &attrib = attribs[idx];
const auto &attrib = attribs[idx];
ASSERT(IsVertexAttribPointerSupported(idx, attrib));
const auto &binding = bindings[attrib.bindingIndex];
......@@ -729,7 +729,7 @@ void VertexArrayGL::applyNumViewsToDivisor(int numViews)
void VertexArrayGL::applyActiveAttribLocationsMask(const gl::AttributesMask &activeMask)
{
gl::AttributesMask updateMask = mProgramActiveAttribLocationsMask ^ activeMask;
gl::AttributesMask updateMask = mProgramActiveAttribLocationsMask ^ activeMask;
if (!updateMask.any())
{
return;
......
......@@ -25,7 +25,7 @@ QueryVk::~QueryVk() = default;
void QueryVk::onDestroy(const gl::Context *context)
{
ContextVk *contextVk = vk::GetImpl(context);
ContextVk *contextVk = vk::GetImpl(context);
vk::DynamicQueryPool *queryPool = contextVk->getQueryPool(getType());
queryPool->freeQuery(contextVk, &mQueryHelper);
queryPool->freeQuery(contextVk, &mQueryHelperTimeElapsedBegin);
......
......@@ -8,12 +8,12 @@
// vertex buffer.
//
#include "libANGLE/angletypes.h"
#include "libANGLE/Context.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/renderer/d3d/IndexDataManager.h"
#include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
#include "libANGLE/renderer/d3d/d3d11/Context11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/IndexDataManager.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_instantiate.h"
......@@ -25,7 +25,6 @@ namespace
class D3D11EmulatedIndexedBufferTest : public ANGLETest
{
protected:
void SetUp() override
{
ANGLETest::SetUp();
......@@ -35,15 +34,15 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
rx::Context11 *context11 = rx::GetImplAs<rx::Context11>(mContext);
mRenderer = context11->getRenderer();
mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer);
GLfloat testData[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f };
mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer);
GLfloat testData[] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
angle::Result error = mSourceBuffer->setData(nullptr, gl::BufferBinding::Array, testData,
sizeof(testData), gl::BufferUsage::StaticDraw);
ASSERT_EQ(angle::Result::Continue(), error);
mTranslatedAttribute.baseOffset = 0;
mTranslatedAttribute.usesFirstVertexOffset = false;
mTranslatedAttribute.stride = sizeof(GLfloat);
mTranslatedAttribute.stride = sizeof(GLfloat);
GLubyte indices[] = {0, 0, 3, 4, 2, 1, 1};
......@@ -62,30 +61,33 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
ANGLETest::TearDown();
}
void createMappableCompareBufferFromEmulatedBuffer(ID3D11Buffer *sourceBuffer, GLuint size, ID3D11Buffer **mappableBuffer)
void createMappableCompareBufferFromEmulatedBuffer(ID3D11Buffer *sourceBuffer,
GLuint size,
ID3D11Buffer **mappableBuffer)
{
*mappableBuffer = nullptr;
D3D11_BUFFER_DESC bufferDesc;
bufferDesc.ByteWidth = size;
bufferDesc.MiscFlags = 0;
bufferDesc.ByteWidth = size;
bufferDesc.MiscFlags = 0;
bufferDesc.StructureByteStride = 0;
bufferDesc.Usage = D3D11_USAGE_STAGING;
bufferDesc.BindFlags = 0;
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
bufferDesc.Usage = D3D11_USAGE_STAGING;
bufferDesc.BindFlags = 0;
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
HRESULT hr = mRenderer->getDevice()->CreateBuffer(&bufferDesc, nullptr, mappableBuffer);
ASSERT_TRUE(SUCCEEDED(hr));
D3D11_BOX srcBox;
srcBox.left = 0;
srcBox.right = size;
srcBox.top = 0;
srcBox.left = 0;
srcBox.right = size;
srcBox.top = 0;
srcBox.bottom = 1;
srcBox.front = 0;
srcBox.back = 1;
srcBox.front = 0;
srcBox.back = 1;
mRenderer->getDeviceContext()->CopySubresourceRegion(*mappableBuffer, 0, 0, 0, 0, sourceBuffer, 0, &srcBox);
mRenderer->getDeviceContext()->CopySubresourceRegion(*mappableBuffer, 0, 0, 0, 0,
sourceBuffer, 0, &srcBox);
}
void compareContents(ID3D11Buffer *actual)
......@@ -96,10 +98,11 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
&compareBuffer);
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT hr = mRenderer->getDeviceContext()->Map(compareBuffer, 0, D3D11_MAP_READ, 0, &mappedResource);
HRESULT hr = mRenderer->getDeviceContext()->Map(compareBuffer, 0, D3D11_MAP_READ, 0,
&mappedResource);
ASSERT_TRUE(SUCCEEDED(hr));
GLfloat* compareData = static_cast<GLfloat*>(mappedResource.pData);
GLfloat *compareData = static_cast<GLfloat *>(mappedResource.pData);
for (size_t i = 0; i < mExpectedExpandedData.size(); i++)
{
EXPECT_EQ(mExpectedExpandedData[i], compareData[i]);
......@@ -161,7 +164,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestNativeToExpandedUsingGLuintIndices)
emulateAndCompare(&srcData);
}
// This tests verifies that a Buffer11 contents remain unchanged after calling getEmulatedIndexedBuffer
// This tests verifies that a Buffer11 contents remain unchanged after calling
// getEmulatedIndexedBuffer
TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpandOperation)
{
// Copy the original source buffer before any expand calls have been made
......@@ -178,7 +182,7 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa
emulateAndCompare(&srcData);
const uint8_t *sourceBufferMem = nullptr;
const uint8_t *cleanBufferMem = nullptr;
const uint8_t *cleanBufferMem = nullptr;
angle::Result error = mSourceBuffer->getData(mContext, &sourceBufferMem);
ASSERT_EQ(angle::Result::Continue(), error);
......@@ -192,7 +196,6 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa
SafeDelete(cleanSourceBuffer);
}
ANGLE_INSTANTIATE_TEST(D3D11EmulatedIndexedBufferTest,
ES2_D3D11());
ANGLE_INSTANTIATE_TEST(D3D11EmulatedIndexedBufferTest, ES2_D3D11());
} // anonymous namespace
} // anonymous namespace
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