Blender  V3.3
gpu_state.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #ifndef GPU_STANDALONE
8 # include "DNA_userdef_types.h"
9 # define PIXELSIZE (U.pixelsize)
10 #else
11 # define PIXELSIZE (1.0f)
12 #endif
13 
14 #include "BLI_math_vector.h"
15 #include "BLI_utildefines.h"
16 
17 #include "GPU_state.h"
18 
19 #include "gpu_context_private.hh"
20 
21 #include "gpu_state_private.hh"
22 
23 using namespace blender::gpu;
24 
25 #define SET_STATE(_prefix, _state, _value) \
26  do { \
27  StateManager *stack = Context::get()->state_manager; \
28  auto &state_object = stack->_prefix##state; \
29  state_object._state = (_value); \
30  } while (0)
31 
32 #define SET_IMMUTABLE_STATE(_state, _value) SET_STATE(, _state, _value)
33 #define SET_MUTABLE_STATE(_state, _value) SET_STATE(mutable_, _state, _value)
34 
35 /* -------------------------------------------------------------------- */
40 {
42 }
43 
45 {
46  SET_IMMUTABLE_STATE(culling_test, culling);
47 }
48 
50 {
52  return (eGPUFaceCullTest)state.culling_test;
53 }
54 
56 {
57  SET_IMMUTABLE_STATE(invert_facing, invert);
58 }
59 
61 {
62  SET_IMMUTABLE_STATE(provoking_vert, vert);
63 }
64 
66 {
67  SET_IMMUTABLE_STATE(depth_test, test);
68 }
69 
71 {
72  SET_IMMUTABLE_STATE(stencil_test, test);
73 }
74 
75 void GPU_line_smooth(bool enable)
76 {
77  SET_IMMUTABLE_STATE(line_smooth, enable);
78 }
79 
80 void GPU_polygon_smooth(bool enable)
81 {
82  SET_IMMUTABLE_STATE(polygon_smooth, enable);
83 }
84 
85 void GPU_logic_op_xor_set(bool enable)
86 {
87  SET_IMMUTABLE_STATE(logic_op_xor, enable);
88 }
89 
91 {
92  SET_IMMUTABLE_STATE(write_mask, mask);
93 }
94 
95 void GPU_color_mask(bool r, bool g, bool b, bool a)
96 {
98  auto &state = stack->state;
99  uint32_t write_mask = state.write_mask;
104  state.write_mask = write_mask;
105 }
106 
107 void GPU_depth_mask(bool depth)
108 {
110  auto &state = stack->state;
111  uint32_t write_mask = state.write_mask;
112  SET_FLAG_FROM_TEST(write_mask, depth, (uint32_t)GPU_WRITE_DEPTH);
113  state.write_mask = write_mask;
114 }
115 
116 void GPU_shadow_offset(bool enable)
117 {
118  SET_IMMUTABLE_STATE(shadow_bias, enable);
119 }
120 
121 void GPU_clip_distances(int distances_enabled)
122 {
123  SET_IMMUTABLE_STATE(clip_distances, distances_enabled);
124 }
125 
126 void GPU_state_set(eGPUWriteMask write_mask,
128  eGPUFaceCullTest culling_test,
129  eGPUDepthTest depth_test,
130  eGPUStencilTest stencil_test,
131  eGPUStencilOp stencil_op,
132  eGPUProvokingVertex provoking_vert)
133 {
135  auto &state = stack->state;
136  state.write_mask = (uint32_t)write_mask;
137  state.blend = (uint32_t)blend;
138  state.culling_test = (uint32_t)culling_test;
139  state.depth_test = (uint32_t)depth_test;
140  state.stencil_test = (uint32_t)stencil_test;
141  state.stencil_op = (uint32_t)stencil_op;
142  state.provoking_vert = (uint32_t)provoking_vert;
143 }
144 
147 /* -------------------------------------------------------------------- */
151 void GPU_depth_range(float near, float far)
152 {
154  auto &state = stack->mutable_state;
155  copy_v2_fl2(state.depth_range, near, far);
156 }
157 
159 {
160  width = max_ff(1.0f, width * PIXELSIZE);
161  SET_MUTABLE_STATE(line_width, width);
162 }
163 
164 void GPU_point_size(float size)
165 {
167  auto &state = stack->mutable_state;
168  /* Keep the sign of point_size since it represents the enable state. */
169  state.point_size = size * ((state.point_size > 0.0) ? 1.0f : -1.0f);
170 }
171 
172 void GPU_program_point_size(bool enable)
173 {
175  auto &state = stack->mutable_state;
176  /* Set point size sign negative to disable. */
177  state.point_size = fabsf(state.point_size) * (enable ? 1 : -1);
178 }
179 
180 void GPU_scissor_test(bool enable)
181 {
183 }
184 
185 void GPU_scissor(int x, int y, int width, int height)
186 {
187  int scissor_rect[4] = {x, y, width, height};
188  Context::get()->active_fb->scissor_set(scissor_rect);
189 }
190 
191 void GPU_viewport(int x, int y, int width, int height)
192 {
193  int viewport_rect[4] = {x, y, width, height};
194  Context::get()->active_fb->viewport_set(viewport_rect);
195 }
196 
198 {
199  SET_MUTABLE_STATE(stencil_reference, (uint8_t)reference);
200 }
201 
203 {
204  SET_MUTABLE_STATE(stencil_write_mask, (uint8_t)write_mask);
205 }
206 
208 {
209  SET_MUTABLE_STATE(stencil_compare_mask, (uint8_t)compare_mask);
210 }
211 
214 /* -------------------------------------------------------------------- */
219 {
221  return (eGPUBlend)state.blend;
222 }
223 
225 {
227  return (eGPUWriteMask)state.write_mask;
228 }
229 
231 {
233  return state.stencil_write_mask;
234 }
235 
237 {
239  return (eGPUDepthTest)state.depth_test;
240 }
241 
243 {
245  return (eGPUStencilTest)state.stencil_test;
246 }
247 
249 {
251  return state.line_width;
252 }
253 
254 void GPU_scissor_get(int coords[4])
255 {
256  Context::get()->active_fb->scissor_get(coords);
257 }
258 
259 void GPU_viewport_size_get_f(float coords[4])
260 {
261  int viewport[4];
262  Context::get()->active_fb->viewport_get(viewport);
263  for (int i = 0; i < 4; i++) {
264  coords[i] = viewport[i];
265  }
266 }
267 
268 void GPU_viewport_size_get_i(int coords[4])
269 {
270  Context::get()->active_fb->viewport_get(coords);
271 }
272 
274 {
276  return (state.write_mask & GPU_WRITE_DEPTH) != 0;
277 }
278 
280 {
281  /* TODO(fclem): this used to be a userdef option. */
282  return true;
283 }
284 
287 /* -------------------------------------------------------------------- */
291 void GPU_flush()
292 {
293  Context::get()->flush();
294 }
295 
297 {
298  Context::get()->finish();
299 }
300 
302 {
304 }
305 
308 /* -------------------------------------------------------------------- */
317 {
318  Context *ctx = Context::get();
319  if (!(ctx && ctx->state_manager)) {
320  return;
321  }
322  StateManager &state_manager = *(Context::get()->state_manager);
323  if (state_manager.use_bgl == false) {
324  /* Expected by many addons (see T80169, T81289).
325  * This will reset the blend function. */
327 
328  /* Equivalent of setting the depth func `glDepthFunc(GL_LEQUAL)`
329  * Needed since Python scripts may enable depth test.
330  * Without this block the depth test function is undefined. */
331  {
332  eGPUDepthTest depth_test_real = GPU_depth_test_get();
333  eGPUDepthTest depth_test_temp = GPU_DEPTH_LESS_EQUAL;
334  if (depth_test_real != depth_test_temp) {
335  GPU_depth_test(depth_test_temp);
336  state_manager.apply_state();
337  GPU_depth_test(depth_test_real);
338  }
339  }
340 
341  state_manager.apply_state();
342  state_manager.use_bgl = true;
343  }
344 }
345 
347 {
348  Context *ctx = Context::get();
349  if (!(ctx && ctx->state_manager)) {
350  return;
351  }
352  StateManager &state_manager = *ctx->state_manager;
353  if (state_manager.use_bgl == true) {
354  state_manager.use_bgl = false;
355  /* Resync state tracking. */
356  state_manager.force_state();
357  }
358 }
359 
361 {
363 }
364 
367 /* -------------------------------------------------------------------- */
372 {
374 }
375 
378 /* -------------------------------------------------------------------- */
383 {
384  /* Set default state. */
392  state.logic_op_xor = false;
393  state.invert_facing = false;
394  state.shadow_bias = false;
395  state.clip_distances = 0;
396  state.polygon_smooth = false;
397  state.line_smooth = false;
398 
399  mutable_state.depth_range[0] = 0.0f;
400  mutable_state.depth_range[1] = 1.0f;
401  mutable_state.point_size = -1.0f; /* Negative is not using point size. */
402  mutable_state.line_width = 1.0f;
406 }
407 
MINLINE float max_ff(float a, float b)
MINLINE void copy_v2_fl2(float v[2], float x, float y)
unsigned int uint
Definition: BLI_sys_types.h:67
#define SET_FLAG_FROM_TEST(value, test, flag)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
eGPUBlend
Definition: GPU_state.h:59
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
eGPUWriteMask
Definition: GPU_state.h:11
@ GPU_WRITE_RED
Definition: GPU_state.h:13
@ GPU_WRITE_GREEN
Definition: GPU_state.h:14
@ GPU_WRITE_BLUE
Definition: GPU_state.h:15
@ GPU_WRITE_DEPTH
Definition: GPU_state.h:17
@ GPU_WRITE_COLOR
Definition: GPU_state.h:19
@ GPU_WRITE_ALPHA
Definition: GPU_state.h:16
eGPUProvokingVertex
Definition: GPU_state.h:113
@ GPU_VERTEX_LAST
Definition: GPU_state.h:114
eGPUFaceCullTest
Definition: GPU_state.h:107
@ GPU_CULL_NONE
Definition: GPU_state.h:108
eGPUBarrier
Definition: GPU_state.h:24
eGPUStencilOp
Definition: GPU_state.h:99
@ GPU_STENCIL_OP_NONE
Definition: GPU_state.h:100
eGPUDepthTest
Definition: GPU_state.h:82
@ GPU_DEPTH_LESS_EQUAL
Definition: GPU_state.h:86
@ GPU_DEPTH_NONE
Definition: GPU_state.h:83
eGPUStencilTest
Definition: GPU_state.h:92
@ GPU_STENCIL_NONE
Definition: GPU_state.h:93
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
static Context * get()
Definition: gpu_context.cc:82
virtual void finish()=0
virtual void flush()=0
void viewport_set(const int viewport[4])
void scissor_set(const int scissor[4])
void scissor_get(int r_scissor[4]) const
void viewport_get(int r_viewport[4]) const
virtual void issue_barrier(eGPUBarrier barrier_bits)=0
virtual void apply_state()=0
virtual void force_state()=0
void GPU_memory_barrier(eGPUBarrier barrier)
Definition: gpu_state.cc:371
void GPU_program_point_size(bool enable)
Definition: gpu_state.cc:172
void GPU_face_culling(eGPUFaceCullTest culling)
Definition: gpu_state.cc:44
eGPUFaceCullTest GPU_face_culling_get()
Definition: gpu_state.cc:49
void GPU_flush()
Definition: gpu_state.cc:291
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_write_mask(eGPUWriteMask mask)
Definition: gpu_state.cc:90
void GPU_scissor_test(bool enable)
Definition: gpu_state.cc:180
void GPU_line_width(float width)
Definition: gpu_state.cc:158
eGPUBlend GPU_blend_get()
Definition: gpu_state.cc:218
void GPU_finish()
Definition: gpu_state.cc:296
void GPU_line_smooth(bool enable)
Definition: gpu_state.cc:75
void GPU_logic_op_xor_set(bool enable)
Definition: gpu_state.cc:85
void GPU_depth_mask(bool depth)
Definition: gpu_state.cc:107
eGPUDepthTest GPU_depth_test_get()
Definition: gpu_state.cc:236
void GPU_bgl_start()
Definition: gpu_state.cc:316
void GPU_stencil_test(eGPUStencilTest test)
Definition: gpu_state.cc:70
void GPU_stencil_write_mask_set(uint write_mask)
Definition: gpu_state.cc:202
bool GPU_mipmap_enabled()
Definition: gpu_state.cc:279
void GPU_color_mask(bool r, bool g, bool b, bool a)
Definition: gpu_state.cc:95
void GPU_depth_range(float near, float far)
Definition: gpu_state.cc:151
void GPU_viewport_size_get_i(int coords[4])
Definition: gpu_state.cc:268
eGPUWriteMask GPU_write_mask_get()
Definition: gpu_state.cc:224
void GPU_stencil_reference_set(uint reference)
Definition: gpu_state.cc:197
void GPU_scissor(int x, int y, int width, int height)
Definition: gpu_state.cc:185
float GPU_line_width_get()
Definition: gpu_state.cc:248
void GPU_stencil_compare_mask_set(uint compare_mask)
Definition: gpu_state.cc:207
eGPUStencilTest GPU_stencil_test_get()
Definition: gpu_state.cc:242
#define SET_MUTABLE_STATE(_state, _value)
Definition: gpu_state.cc:33
void GPU_front_facing(bool invert)
Definition: gpu_state.cc:55
void GPU_viewport(int x, int y, int width, int height)
Definition: gpu_state.cc:191
#define PIXELSIZE
Definition: gpu_state.cc:9
void GPU_point_size(float size)
Definition: gpu_state.cc:164
uint GPU_stencil_mask_get()
Definition: gpu_state.cc:230
void GPU_bgl_end()
Definition: gpu_state.cc:346
bool GPU_bgl_get()
Definition: gpu_state.cc:360
void GPU_state_set(eGPUWriteMask write_mask, eGPUBlend blend, eGPUFaceCullTest culling_test, eGPUDepthTest depth_test, eGPUStencilTest stencil_test, eGPUStencilOp stencil_op, eGPUProvokingVertex provoking_vert)
Definition: gpu_state.cc:126
#define SET_IMMUTABLE_STATE(_state, _value)
Definition: gpu_state.cc:32
void GPU_depth_test(eGPUDepthTest test)
Definition: gpu_state.cc:65
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:259
void GPU_apply_state()
Definition: gpu_state.cc:301
bool GPU_depth_mask_get()
Definition: gpu_state.cc:273
void GPU_scissor_get(int coords[4])
Definition: gpu_state.cc:254
void GPU_clip_distances(int distances_enabled)
Definition: gpu_state.cc:121
void GPU_provoking_vertex(eGPUProvokingVertex vert)
Definition: gpu_state.cc:60
void GPU_polygon_smooth(bool enable)
Definition: gpu_state.cc:80
void GPU_shadow_offset(bool enable)
Definition: gpu_state.cc:116
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: invert.h:8
const int state
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define fabsf(x)
Definition: metal/compat.h:219
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
unsigned int uint32_t
Definition: stdint.h:80
unsigned char uint8_t
Definition: stdint.h:78
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)