23 "ERROR: glShaderBuffer - element size and count combo is less than the minimum alignment requirement for current hardware! Pad the element size and or count a bit" );
28 "ERROR: glShaderBuffer - element size is less than the minimum alignment requirement for current hardware! Pad the element size a bit" );
31 _alignedBufferSize =
static_cast<ptrdiff_t
>(
realign_offset( _alignedBufferSize, _alignmentRequirement ));
36 ? gl46core::GL_SHADER_STORAGE_BUFFER
37 : gl46core::GL_UNIFORM_BUFFER;
74 if ( readIndex == -1 )
84 else if ( range.
_length > 0 ) [[likely]]
86 const size_t offset =
bufferImpl()->memoryBlock()._offset + range.
_startOffset + (readIndex * _alignedBufferSize);
#define PROFILE_SCOPE_AUTO(CATEGORY)
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
static GLStateTracker & GetStateTracker() noexcept
GFXDevice & context() const noexcept
I32 queueReadIndex() const noexcept
U16 queueLength() const noexcept
FORCE_INLINE BufferUsageType getUsage() const noexcept
static U8 k_commandBufferID
bool bindByteRange(U8 bindIndex, BufferRange range, I32 readIndex=-1)
const glBufferImpl_uptr & bufferImpl() const noexcept
BufferLock writeBytesInternal(BufferRange range, const bufferPtr data) override
void readBytesInternal(BufferRange range, std::pair< bufferPtr, size_t > outData) override
glBufferImpl_uptr _bufferImpl
glShaderBuffer(GFXDevice &context, const ShaderBufferDescriptor &descriptor)
LockableBuffer * getBufferImpl() override final
constexpr Optick::Category::Type Graphics
FORCE_INLINE size_t GetAlignmentCorrected(const size_t value, const size_t alignment) noexcept
Handle console commands that start with a forward slash.
constexpr size_t realign_offset(const size_t offset, const size_t align) noexcept
constexpr size_t to_size(const T value)
BufferParams _bufferParams
size_t _elementSize
Buffer primitive size in bytes.
size_t _drawIndirectBufferOffset
BindResult setActiveBuffer(gl46core::GLenum target, gl46core::GLuint bufferHandle)
Single place to change buffer objects for every target available.
BindResult setActiveBufferIndexRange(gl46core::GLenum target, gl46core::GLuint bufferHandle, gl46core::GLuint bindIndex, size_t offsetInBytes, size_t rangeInBytes)
Same as normal setActiveBuffer but handles proper binding of different ranges.
std::pair< bufferPtr, size_t > _initialData
bool _separateReadWrite
Use a separate read/write index based on queue length.