11# define PIXELSIZE (U.pixelsize)
13# define PIXELSIZE (1.0f)
28#define SET_STATE(_prefix, _state, _value) \
30 StateManager *stack = Context::get()->state_manager; \
31 auto &state_object = stack->_prefix##state; \
32 state_object._state = (_value); \
35#define SET_IMMUTABLE_STATE(_state, _value) SET_STATE(, _state, _value)
36#define SET_MUTABLE_STATE(_state, _value) SET_STATE(mutable_, _state, _value)
107 state.write_mask = write_mask;
116 state.write_mask = write_mask;
190 int scissor_rect[4] = {
x,
y, width, height};
196 int viewport_rect[4] = {
x,
y, width, height};
266 for (
int i = 0; i < 4; i++) {
267 coords[i] = viewport[i];
326 if (state_manager.
use_bgl ==
false) {
337 if (depth_test_real != depth_test_temp) {
356 if (state_manager.
use_bgl ==
true) {
MINLINE float max_ff(float a, float b)
MINLINE void copy_v2_fl2(float v[2], float x, float y)
#define SET_FLAG_FROM_TEST(value, test, flag)
StateManager * state_manager
void viewport_set(const int viewport[4])
void scissor_set(const int scissor[4])
void scissor_test_set(bool test)
void scissor_get(int r_scissor[4]) const
void viewport_get(int r_viewport[4]) const
static GPUBackend * get()
virtual Fence * fence_alloc()=0
virtual void issue_barrier(eGPUBarrier barrier_bits)=0
virtual void apply_state()=0
GPUStateMutable mutable_state
virtual void force_state()=0
local_group_size(16, 16) .push_constant(Type b
void GPU_memory_barrier(eGPUBarrier barrier)
void GPU_program_point_size(bool enable)
void GPU_face_culling(eGPUFaceCullTest culling)
eGPUFaceCullTest GPU_face_culling_get()
void GPU_blend(eGPUBlend blend)
void GPU_write_mask(eGPUWriteMask mask)
void GPU_scissor_test(bool enable)
void GPU_line_width(float width)
eGPUBlend GPU_blend_get()
void GPU_line_smooth(bool enable)
void GPU_logic_op_xor_set(bool enable)
void GPU_depth_mask(bool depth)
eGPUDepthTest GPU_depth_test_get()
void GPU_stencil_test(eGPUStencilTest test)
void GPU_stencil_write_mask_set(uint write_mask)
bool GPU_mipmap_enabled()
void GPU_color_mask(bool r, bool g, bool b, bool a)
GPUFence * GPU_fence_create()
void GPU_depth_range(float near, float far)
void GPU_viewport_size_get_i(int coords[4])
eGPUWriteMask GPU_write_mask_get()
void GPU_stencil_reference_set(uint reference)
void GPU_scissor(int x, int y, int width, int height)
float GPU_line_width_get()
void GPU_stencil_compare_mask_set(uint compare_mask)
eGPUStencilTest GPU_stencil_test_get()
#define SET_MUTABLE_STATE(_state, _value)
void GPU_front_facing(bool invert)
void GPU_viewport(int x, int y, int width, int height)
void GPU_fence_wait(GPUFence *fence)
void GPU_point_size(float size)
uint GPU_stencil_mask_get()
void GPU_state_set(eGPUWriteMask write_mask, eGPUBlend blend, eGPUFaceCullTest culling_test, eGPUDepthTest depth_test, eGPUStencilTest stencil_test, eGPUStencilOp stencil_op, eGPUProvokingVertex provoking_vert)
#define SET_IMMUTABLE_STATE(_state, _value)
void GPU_fence_signal(GPUFence *fence)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
bool GPU_depth_mask_get()
void GPU_scissor_get(int coords[4])
void GPU_clip_distances(int distances_enabled)
void GPU_fence_free(GPUFence *fence)
void GPU_provoking_vertex(eGPUProvokingVertex vert)
void GPU_polygon_smooth(bool enable)
void GPU_shadow_offset(bool enable)
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
static Context * unwrap(GPUContext *ctx)
static GPUContext * wrap(Context *ctx)
uint8_t stencil_compare_mask
uint8_t stencil_write_mask
uint8_t stencil_reference