Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoGpuBufferObject.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20
21#ifndef SO_GPU_BUFFER_OBJECT_H
22#define SO_GPU_BUFFER_OBJECT_H
23
24#include <Inventor/devices/SoBufferObject.h>
25#include <Inventor/devices/SoCpuBufferObject.h>
26
28namespace inventor
29{
30namespace renderer
31{
32template<typename ResourceType> struct Resource;
33}
34}
37SO_PIMPL_PUBLIC_DECLARATION(SoGpuBufferObject)
38
39
198{
199 SO_TYPED_CLASS_HEADER();
200 SO_PIMPL_PUBLIC_HEADER(SoGpuBufferObject)
201
202public:
203
209 {
212
214 DYNAMIC
215 };
216
224 {
230
237 DEVICE
238 };
239
246 SoGpuBufferObject( BufferAccessFrequency accessFrequency = STATIC, BufferAccessNature accessNature = SHARED );
247
251 virtual bool setSize( size_t size );
252
259
263 virtual void clearInstance();
264
267
270
271private:
272
273 void copyToCpuBuffer(SoCpuBufferObject* targetBufferObject, size_t destOffset = 0, size_t sourceOffset = 0, size_t copySize = SO_BUFFER_SIZE_ALL);
274
275private:
281
282 friend struct inventor::renderer::Resource<SoBufferObject>;
283};
284
285#endif // SO_GPU_BUFFER_OBJECT_H
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> GPU buffer objec...
virtual bool setSize(size_t size)
Sets the size in bytes of the buffer object.
BufferAccessNature getAccessNature() const
Returns the current buffer access nature hint for this buffer object.
BufferAccessFrequency getAccessFrequency() const
Returns the current buffer access frequency hint for this buffer object.
virtual SoBufferObject * createInstance() const
Create a new buffer with the same properties as the current one.
BufferAccessFrequency
Available values for hints on how frequently the application will be changing the buffer's data.
@ STATIC
The application will set the data once.
virtual void clearInstance()
This function clears the content of the buffer, it frees the memory if the mode was COPY.
SoGpuBufferObject(BufferAccessFrequency accessFrequency=STATIC, BufferAccessNature accessNature=SHARED)
Constructor.
BufferAccessNature
Available values for hints on the nature of the application's access to the buffer.
@ SHARED
The application will be writing data to the buffer, but will not read it.