mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 22:28:32 +09:00
[Feat|Perf] (*/BufferState): Improve dirty mark for Buffer.
This commit is contained in:
@@ -25,6 +25,7 @@ namespace MobileGL {
|
||||
SizeT GetByteSize(Uint level) const;
|
||||
void MarkDirty(Uint level, bool dirty);
|
||||
bool IsDirty(Uint level) const;
|
||||
|
||||
protected:
|
||||
Vector<IntVec3> m_texelSizes;
|
||||
Vector<Vector<Uint8>> m_data;
|
||||
|
||||
@@ -19,7 +19,9 @@ namespace MobileGL {
|
||||
template <SizeT TargetCount>
|
||||
class MipmapUploadTargetArray {
|
||||
public:
|
||||
MipmapUploadTargetArray() { static_assert(TargetCount > 0, "Upload target count must be greater than zero"); }
|
||||
MipmapUploadTargetArray() {
|
||||
static_assert(TargetCount > 0, "Upload target count must be greater than zero");
|
||||
}
|
||||
|
||||
void AllocateLevel(Uint targetIndex, Uint level, MipmapInput input) {
|
||||
MOBILEGL_ASSERT(targetIndex < TargetCount, "AllocateLevel: target invalid");
|
||||
|
||||
@@ -81,7 +81,8 @@ namespace MobileGL {
|
||||
|
||||
class TextureObjectMipmap : public TextureObjectBase {
|
||||
public:
|
||||
TextureObjectMipmap(TextureTarget target, Uint externalIndex): TextureObjectBase(target, externalIndex) {}
|
||||
TextureObjectMipmap(TextureTarget target, Uint externalIndex)
|
||||
: TextureObjectBase(target, externalIndex) {}
|
||||
|
||||
TextureStorageType GetStorageType() const override { return TextureStorageType::Mipmap; }
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace MobileGL {
|
||||
TextureStorageType GetStorageType() const override { return TextureStorageType::Buffer; }
|
||||
explicit TextureObjectBuffer(Uint externalIndex);
|
||||
const Vector<TextureUploadTarget>& GetUploadTargets() const override { return m_uploadTargets; }
|
||||
BindingSlot<BufferObject>& GetBufferBindingSlot(TextureUploadTarget target = TextureUploadTarget::TextureBuffer);
|
||||
BindingSlot<BufferObject>& GetBufferBindingSlot(
|
||||
TextureUploadTarget target = TextureUploadTarget::TextureBuffer);
|
||||
|
||||
protected:
|
||||
Uint GetIndexOfTextureUploadTarget(TextureUploadTarget target) const override;
|
||||
|
||||
Reference in New Issue
Block a user