Created a BufferStorage abstract class.

TRAC #22297 Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1879 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 9cdced65
......@@ -262,6 +262,8 @@
'libGLESv2/Renderbuffer.h',
'libGLESv2/renderer/Blit.cpp',
'libGLESv2/renderer/Blit.h',
'libGLESv2/renderer/BufferStorage.h',
'libGLESv2/renderer/BufferStorage.cpp',
'libGLESv2/renderer/FenceImpl.h',
'libGLESv2/renderer/Fence9.cpp',
'libGLESv2/renderer/Fence9.h',
......
......@@ -246,6 +246,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<ClCompile Include="renderer\Blit.cpp" />
<ClCompile Include="renderer\Fence11.cpp" />
<ClCompile Include="renderer\Fence9.cpp" />
<ClCompile Include="renderer\BufferStorage.cpp" />
<ClCompile Include="renderer\Image.cpp" />
<ClCompile Include="renderer\Image9.cpp" />
<ClCompile Include="renderer\IndexBuffer.cpp" />
......@@ -308,6 +309,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<ClInclude Include="renderer\Fence11.h" />
<ClInclude Include="renderer\Fence9.h" />
<ClInclude Include="renderer\FenceImpl.h" />
<ClInclude Include="renderer\BufferStorage.h" />
<ClInclude Include="renderer\generatemip.h" />
<ClInclude Include="renderer\Image.h" />
<ClInclude Include="renderer\Image11.h" />
......
......@@ -191,6 +191,9 @@
<ClCompile Include="renderer\Fence11.cpp">
<Filter>Renderer</Filter>
</ClCompile>
<ClCompile Include="renderer\BufferStorage.cpp">
<Filter>Renderer</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BinaryStream.h">
......@@ -439,6 +442,9 @@
<ClInclude Include="renderer\Fence11.h">
<Filter>Renderer</Filter>
</ClInclude>
<ClInclude Include="renderer\BufferStorage.h">
<Filter>Renderer</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="libGLESv2.def">
......
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// BufferStorage.cpp Defines the abstract BufferStorage class.
#include "libGLESv2/renderer/BufferStorage.h"
namespace rx
{
unsigned int BufferStorage::mNextSerial = 1;
BufferStorage::BufferStorage()
{
updateSerial();
}
BufferStorage::~BufferStorage()
{
}
unsigned int BufferStorage::getSerial() const
{
return mSerial;
}
void BufferStorage::updateSerial()
{
mSerial = mNextSerial++;
}
void BufferStorage::markBufferUsage()
{
}
}
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// BufferStorage.h Defines the abstract BufferStorage class.
#ifndef LIBGLESV2_RENDERER_BUFFERSTORAGE_H_
#define LIBGLESV2_RENDERER_BUFFERSTORAGE_H_
#include "common/angleutils.h"
namespace rx
{
class BufferStorage
{
public:
BufferStorage();
virtual ~BufferStorage();
// The data returned is only guaranteed valid until next non-const method.
virtual void *getData() = 0;
virtual void setData(const void* data, unsigned int size, unsigned int offset) = 0;
virtual void clear() = 0;
virtual unsigned int getSize() const = 0;
virtual bool supportsDirectBinding() const = 0;
virtual void markBufferUsage();
unsigned int getSerial() const;
protected:
void updateSerial();
private:
DISALLOW_COPY_AND_ASSIGN(BufferStorage);
unsigned int mSerial;
static unsigned int mNextSerial;
};
}
#endif // LIBGLESV2_RENDERER_BUFFERSTORAGE_H_
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