Commit 7efe747c by Jamie Madill Committed by Commit Bot

D3D11: Fix style in the entire back-end.

BUG=None Change-Id: I32cbcd4daa1f386654ea5e8f0a25d8635b5df731 Reviewed-on: https://chromium-review.googlesource.com/402016Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent a284f2ff
......@@ -4,7 +4,8 @@
// found in the LICENSE file.
//
// Fence11.cpp: Defines the rx::FenceNV11 and rx::FenceSync11 classes which implement rx::FenceNVImpl and rx::FenceSyncImpl.
// Fence11.cpp: Defines the rx::FenceNV11 and rx::FenceSync11 classes which implement
// rx::FenceNVImpl and rx::FenceSyncImpl.
#include "libANGLE/renderer/d3d/d3d11/Fence11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
......@@ -20,7 +21,7 @@ static const int kDeviceLostCheckPeriod = 64;
// Template helpers for set and test operations.
//
template<class FenceClass>
template <class FenceClass>
gl::Error FenceSetHelper(FenceClass *fence)
{
if (!fence->mQuery)
......@@ -32,7 +33,8 @@ gl::Error FenceSetHelper(FenceClass *fence)
HRESULT result = fence->mRenderer->getDevice()->CreateQuery(&queryDesc, &fence->mQuery);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to create event query, result: 0x%X.", result);
return gl::Error(GL_OUT_OF_MEMORY, "Failed to create event query, result: 0x%X.",
result);
}
}
......@@ -46,7 +48,8 @@ gl::Error FenceTestHelper(FenceClass *fence, bool flushCommandBuffer, GLboolean
ASSERT(fence->mQuery);
UINT getDataFlags = (flushCommandBuffer ? 0 : D3D11_ASYNC_GETDATA_DONOTFLUSH);
HRESULT result = fence->mRenderer->getDeviceContext()->GetData(fence->mQuery, NULL, 0, getDataFlags);
HRESULT result =
fence->mRenderer->getDeviceContext()->GetData(fence->mQuery, NULL, 0, getDataFlags);
if (FAILED(result))
{
......@@ -62,10 +65,7 @@ gl::Error FenceTestHelper(FenceClass *fence, bool flushCommandBuffer, GLboolean
// FenceNV11
//
FenceNV11::FenceNV11(Renderer11 *renderer)
: FenceNVImpl(),
mRenderer(renderer),
mQuery(NULL)
FenceNV11::FenceNV11(Renderer11 *renderer) : FenceNVImpl(), mRenderer(renderer), mQuery(NULL)
{
}
......@@ -121,10 +121,7 @@ gl::Error FenceNV11::finish()
// We still opt to use QPC. In the present and moving forward, most newer systems will not suffer
// from buggy implementations.
FenceSync11::FenceSync11(Renderer11 *renderer)
: FenceSyncImpl(),
mRenderer(renderer),
mQuery(NULL)
FenceSync11::FenceSync11(Renderer11 *renderer) : FenceSyncImpl(), mRenderer(renderer), mQuery(NULL)
{
LARGE_INTEGER counterFreqency = {};
BOOL success = QueryPerformanceFrequency(&counterFreqency);
......@@ -218,8 +215,8 @@ gl::Error FenceSync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *ou
gl::Error FenceSync11::serverWait(GLbitfield flags, GLuint64 timeout)
{
// Because our API is currently designed to be called from a single thread, we don't need to do
// extra work for a server-side fence. GPU commands issued after the fence is created will always
// be processed after the fence is signaled.
// extra work for a server-side fence. GPU commands issued after the fence is created will
// always be processed after the fence is signaled.
return gl::Error(GL_NO_ERROR);
}
......@@ -229,8 +226,8 @@ gl::Error FenceSync11::getStatus(GLint *outResult)
gl::Error error = FenceTestHelper(this, false, &result);
if (error.isError())
{
// The spec does not specify any way to report errors during the status test (e.g. device lost)
// so we report the fence is unblocked in case of error or signaled.
// The spec does not specify any way to report errors during the status test (e.g. device
// lost) so we report the fence is unblocked in case of error or signaled.
*outResult = GL_SIGNALED;
return error;
......
......@@ -250,7 +250,9 @@ gl::Error Query11::testQuery(QueryState *queryState)
context->GetData(queryState->query, &numPixels, sizeof(numPixels), 0);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to get the data of an internal query, result: 0x%X.", result);
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to get the data of an internal query, result: 0x%X.",
result);
}
if (result == S_OK)
......@@ -264,11 +266,13 @@ gl::Error Query11::testQuery(QueryState *queryState)
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
{
ASSERT(queryState->query);
D3D11_QUERY_DATA_SO_STATISTICS soStats = { 0 };
D3D11_QUERY_DATA_SO_STATISTICS soStats = {0};
HRESULT result = context->GetData(queryState->query, &soStats, sizeof(soStats), 0);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to get the data of an internal query, result: 0x%X.", result);
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to get the data of an internal query, result: 0x%X.",
result);
}
if (result == S_OK)
......
......@@ -41,7 +41,7 @@ gl::Error VertexBuffer11::initialize(unsigned int size, bool dynamicUsage)
if (size > 0)
{
ID3D11Device* dxDevice = mRenderer->getDevice();
ID3D11Device *dxDevice = mRenderer->getDevice();
D3D11_BUFFER_DESC bufferDesc;
bufferDesc.ByteWidth = size;
......@@ -54,7 +54,8 @@ gl::Error VertexBuffer11::initialize(unsigned int size, bool dynamicUsage)
HRESULT result = dxDevice->CreateBuffer(&bufferDesc, NULL, &mBuffer);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to allocate internal vertex buffer of size, %lu.", size);
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to allocate internal vertex buffer of size, %lu.", size);
}
if (dynamicUsage)
......@@ -81,13 +82,15 @@ gl::Error VertexBuffer11::mapResource()
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT result = dxContext->Map(mBuffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mappedResource);
HRESULT result =
dxContext->Map(mBuffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mappedResource);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal vertex buffer, HRESULT: 0x%08x.", result);
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to map internal vertex buffer, HRESULT: 0x%08x.", result);
}
mMappedResourceData = reinterpret_cast<uint8_t*>(mappedResource.pData);
mMappedResourceData = reinterpret_cast<uint8_t *>(mappedResource.pData);
}
return gl::Error(GL_NO_ERROR);
......@@ -133,7 +136,8 @@ gl::Error VertexBuffer11::storeVertexAttributes(const gl::VertexAttribute &attri
gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib, currentValueType);
const D3D_FEATURE_LEVEL featureLevel = mRenderer->getRenderer11DeviceCaps().featureLevel;
const d3d11::VertexFormat &vertexFormatInfo = d3d11::GetVertexFormatInfo(vertexFormatType, featureLevel);
const d3d11::VertexFormat &vertexFormatInfo =
d3d11::GetVertexFormatInfo(vertexFormatType, featureLevel);
ASSERT(vertexFormatInfo.copyFunction != NULL);
vertexFormatInfo.copyFunction(input, inputStride, count, output);
......@@ -170,7 +174,8 @@ gl::Error VertexBuffer11::discard()
HRESULT result = dxContext->Map(mBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
if (FAILED(result))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal buffer for discarding, HRESULT: 0x%08x", result);
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to map internal buffer for discarding, HRESULT: 0x%08x", result);
}
dxContext->Unmap(mBuffer, 0);
......
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