FastUIDraw
inc
fastuidraw
util
gpu_dirty_state.hpp
Go to the documentation of this file.
1
/*!
2
* \file gpu_dirty_state.hpp
3
* \brief file gpu_dirty_state.hpp
4
*
5
* Copyright 2018 by Intel.
6
*
7
* Contact: kevin.rogovin@gmail.com
8
*
9
* This Source Code Form is subject to the
10
* terms of the Mozilla Public License, v. 2.0.
11
* If a copy of the MPL was not distributed with
12
* this file, You can obtain one at
13
* http://mozilla.org/MPL/2.0/.
14
*
15
* \author Kevin Rogovin <kevin.rogovin@gmail.com>
16
*
17
*/
18
19
#ifndef FASTUIDRAW_GPU_DIRTY_STATE_HPP
20
#define FASTUIDRAW_GPU_DIRTY_STATE_HPP
21
22
#include <stdint.h>
23
24
namespace
fastuidraw
25
{
26
/*!\addtogroup Utility
27
* @{
28
*/
29
/*!
30
* Object to encapsulate GPU dirty state via bit-flags.
31
*/
32
class
gpu_dirty_state
33
{
34
public
:
35
/*!
36
* Enumeration to specify the bit-flags to specify
37
* dirty GPU state.
38
*/
39
enum
bit_flags
40
{
41
/*!
42
* If this bit is up, indicates that the shaders used
43
* by the GPU has changed.
44
*/
45
shader
= 1 << 0,
46
47
/*!
48
* If this bit is up, indicates that the binding
49
* of the texture binding slots used by the shader
50
* of a PainterBackend derived class have changed.
51
* For example, in GL these changes are accompished
52
* by calling glBindTexture().
53
*/
54
textures
= 1 << 1,
55
56
/*!
57
* If this bit is up, indicates that the binding
58
* of the image binding slots used by the shader
59
* of a PainterBackend derived class have changed.
60
* For example, in GL these changes are accompished
61
* by calling glBindImageTexture().
62
*/
63
images
= 1 << 2,
64
65
/*!
66
* If this bit is up, indicates that the blend
67
* state of the GPU has changed.
68
*/
69
blend_mode
= 1 << 3,
70
71
/*!
72
* If this bit is up, indicates that the bound
73
* render-target of the GPU has changed. For example,
74
* in GL changing the render-target is accomplished
75
* by glBindFramgebuffer() and/or glDrawBuffers().
76
*/
77
render_target
= 1 << 4,
78
79
/*!
80
* If this bit is up, indicates that the viewport
81
* or scissor values have changed. For example, in GL
82
* this is accomplished by calling glViewport(),
83
* glScissor() or glEnable/glDisable() passing
84
* GL_SCISSOR_TEST.
85
*/
86
viewport_scissor
= 1 << 5,
87
88
/*!
89
* If this bit is up, indicates that the source or format
90
* for index or vertex buffers has changed. For example,
91
* in GL, this can be accomplished by calling
92
* glBindVertexArray() or modifying the currently bound
93
* vertex array object.
94
*/
95
vertex_index_source
= 1 << 6,
96
97
/*!
98
* If this bit is up, indicates that a constant buffer
99
* source has changed. For GL, these are UBOs. For example,
100
* in GL, this can be accomplished by calling glBindBuffer()
101
* with the binding target as GL_UNIFORM_BUFFER.
102
*/
103
constant_buffers
= 1 << 7,
104
105
/*!
106
* If this bit is up, indicates that a storage buffer
107
* source has changed. For GL, these are UBOs. For example,
108
* in GL, this can be accomplished by calling glBindBuffer()
109
* with the binding target as GL_SHADER_STORAGE_BUFFER.
110
*/
111
storage_buffers
= 1 << 8,
112
113
/*!
114
* If this bit is up, the depth or stencil test has been
115
* modified.
116
*/
117
depth_stencil
= 1 << 9,
118
119
/*!
120
* If this bit is up, the color, depth or stencil masks
121
* have changed. For example, in GL this is accomlished
122
* by called glColorMask() glDepthMask() or glStencilMask().
123
*/
124
buffer_masks
= 1 << 10,
125
126
/*!
127
* If this bit is up, indicates that the HW clip planes
128
* has changed.
129
*/
130
hw_clip
= 1 << 11,
131
132
/*!
133
* Specify that all state is dirty.
134
*/
135
all
= ~0u,
136
};
137
138
/*!
139
* Ctor.
140
* \param flags bit field using \ref bit_flags to specify
141
* what portion of GPU state is firty
142
*/
143
gpu_dirty_state
(uint32_t flags = 0u):
144
m_flags(flags)
145
{}
146
147
/*!
148
* Implicit cast-operator to uint32_t.
149
*/
150
operator
uint32_t()
const
{
return
m_flags; }
151
152
/*!
153
* Implicit cast-operator to uint32_t.
154
*/
155
operator
uint32_t&() {
return
m_flags; }
156
157
private
:
158
uint32_t m_flags;
159
};
160
/*! @} */
161
}
162
163
#endif
fastuidraw::gpu_dirty_state::hw_clip
Definition:
gpu_dirty_state.hpp:130
fastuidraw::gpu_dirty_state
Definition:
gpu_dirty_state.hpp:32
fastuidraw
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition:
colorstop.hpp:28
fastuidraw::gpu_dirty_state::images
Definition:
gpu_dirty_state.hpp:63
fastuidraw::gpu_dirty_state::storage_buffers
Definition:
gpu_dirty_state.hpp:111
fastuidraw::gpu_dirty_state::textures
Definition:
gpu_dirty_state.hpp:54
fastuidraw::gpu_dirty_state::gpu_dirty_state
gpu_dirty_state(uint32_t flags=0u)
Definition:
gpu_dirty_state.hpp:143
fastuidraw::gpu_dirty_state::render_target
Definition:
gpu_dirty_state.hpp:77
fastuidraw::gpu_dirty_state::all
Definition:
gpu_dirty_state.hpp:135
fastuidraw::gpu_dirty_state::constant_buffers
Definition:
gpu_dirty_state.hpp:103
fastuidraw::gpu_dirty_state::buffer_masks
Definition:
gpu_dirty_state.hpp:124
fastuidraw::gpu_dirty_state::depth_stencil
Definition:
gpu_dirty_state.hpp:117
fastuidraw::gpu_dirty_state::blend_mode
Definition:
gpu_dirty_state.hpp:69
fastuidraw::gpu_dirty_state::vertex_index_source
Definition:
gpu_dirty_state.hpp:95
fastuidraw::gpu_dirty_state::bit_flags
bit_flags
Definition:
gpu_dirty_state.hpp:39
fastuidraw::gpu_dirty_state::viewport_scissor
Definition:
gpu_dirty_state.hpp:86
fastuidraw::gpu_dirty_state::shader
Definition:
gpu_dirty_state.hpp:45
Generated by
1.8.13