-
Notifications
You must be signed in to change notification settings - Fork 0
/
OBuffer.cc
52 lines (39 loc) · 2.3 KB
/
OBuffer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <sstream>
#include "PLOG.hh"
#include "OBuffer.hh"
#include "OXPPNS.hh"
const char* OBuffer::RT_BUFFER_INPUT_ = "INPUT" ;
const char* OBuffer::RT_BUFFER_OUTPUT_ = "OUTPUT" ;
const char* OBuffer::RT_BUFFER_INPUT_OUTPUT_ = "INPUT_OUTPUT" ;
const char* OBuffer::RT_BUFFER_PROGRESSIVE_STREAM_ = "PROGRESSIVE_STREAM" ;
const char* OBuffer::RT_BUFFER_LAYERED_ = "LAYERED" ;
const char* OBuffer::RT_BUFFER_CUBEMAP_ = "CUBEMAP" ;
const char* OBuffer::RT_BUFFER_GPU_LOCAL_ = "GPU_LOCAL" ;
const char* OBuffer::RT_BUFFER_COPY_ON_DIRTY_ = "COPY_ON_DIRTY" ;
std::string OBuffer::BufferDesc(unsigned buffer_desc) // static
{
std::stringstream ss ;
if( buffer_desc & RT_BUFFER_INPUT ) ss << RT_BUFFER_INPUT_ << " " ;
if( buffer_desc & RT_BUFFER_OUTPUT ) ss << RT_BUFFER_OUTPUT_ << " " ;
if( buffer_desc & RT_BUFFER_INPUT_OUTPUT ) ss << RT_BUFFER_INPUT_OUTPUT_ << " " ;
if( buffer_desc & RT_BUFFER_PROGRESSIVE_STREAM ) ss << RT_BUFFER_PROGRESSIVE_STREAM_ << " " ;
if( buffer_desc & RT_BUFFER_LAYERED ) ss << RT_BUFFER_LAYERED_ << " " ;
if( buffer_desc & RT_BUFFER_CUBEMAP ) ss << RT_BUFFER_CUBEMAP_ << " " ;
if( buffer_desc & RT_BUFFER_GPU_LOCAL ) ss << RT_BUFFER_GPU_LOCAL_ << " " ;
if( buffer_desc & RT_BUFFER_COPY_ON_DIRTY ) ss << RT_BUFFER_COPY_ON_DIRTY_ << " " ;
return ss.str();
}
void OBuffer::Dump(const char* msg) // static
{
LOG(info) << msg ;
std::cout
<< std::setw(5) << RT_BUFFER_INPUT << std::setw(30) << RT_BUFFER_INPUT_ << std::endl
<< std::setw(5) << RT_BUFFER_OUTPUT << std::setw(30) << RT_BUFFER_OUTPUT_ << std::endl
<< std::setw(5) << RT_BUFFER_INPUT_OUTPUT << std::setw(30) << RT_BUFFER_INPUT_OUTPUT_ << std::endl
<< std::setw(5) << RT_BUFFER_GPU_LOCAL << std::setw(30) << RT_BUFFER_GPU_LOCAL_ << std::endl
<< std::setw(5) << RT_BUFFER_COPY_ON_DIRTY << std::setw(30) << RT_BUFFER_COPY_ON_DIRTY_ << std::endl
<< std::setw(5) << RT_BUFFER_PROGRESSIVE_STREAM << std::setw(30) << RT_BUFFER_PROGRESSIVE_STREAM_ << std::endl
<< std::setw(5) << RT_BUFFER_LAYERED << std::setw(30) << RT_BUFFER_LAYERED_ << std::endl
<< std::setw(5) << RT_BUFFER_CUBEMAP << std::setw(30) << RT_BUFFER_CUBEMAP_ << std::endl
;
}