Lines Matching refs:state
106 ggl_set_surface(c, &c->state.texture[tmu].surface, surface); in ggl_bindTextureLod()
112 if (surface->format != c->state.buffers.color.format) in ggl_colorBuffer()
115 if (surface->width > c->state.buffers.coverageBufferSize) { in ggl_colorBuffer()
117 free(c->state.buffers.coverage); in ggl_colorBuffer()
118 c->state.buffers.coverage = (int16_t*)malloc(surface->width * 2); in ggl_colorBuffer()
119 c->state.buffers.coverageBufferSize = in ggl_colorBuffer()
120 c->state.buffers.coverage ? surface->width : 0; in ggl_colorBuffer()
122 ggl_set_surface(c, &(c->state.buffers.color), surface); in ggl_colorBuffer()
123 if (c->state.buffers.read.format == 0) { in ggl_colorBuffer()
124 ggl_set_surface(c, &(c->state.buffers.read), surface); in ggl_colorBuffer()
132 ggl_set_surface(c, &(c->state.buffers.read), surface); in ggl_readBuffer()
139 ggl_set_surface(c, &(c->state.buffers.depth), surface); in ggl_depthBuffer()
141 c->state.buffers.depth.format = GGL_PIXEL_FORMAT_NONE; in ggl_depthBuffer()
150 c->state.scissor.user_left = x; in ggl_scissor()
151 c->state.scissor.user_top = y; in ggl_scissor()
152 c->state.scissor.user_right = x + width; in ggl_scissor()
153 c->state.scissor.user_bottom = y + height; in ggl_scissor()
202 if (c->state.enables & GGL_ENABLE_SMOOTH) { in ggl_shadeModel()
203 c->state.enables &= ~GGL_ENABLE_SMOOTH; in ggl_shadeModel()
208 if (!(c->state.enables & GGL_ENABLE_SMOOTH)) { in ggl_shadeModel()
209 c->state.enables |= GGL_ENABLE_SMOOTH; in ggl_shadeModel()
284 c->state.fog.color[GGLFormat::ALPHA]= 0xFF; // unused in ggl_fogColor3xv()
285 c->state.fog.color[GGLFormat::RED] = (r - (r>>8))>>8; in ggl_fogColor3xv()
286 c->state.fog.color[GGLFormat::GREEN]= (g - (g>>8))>>8; in ggl_fogColor3xv()
287 c->state.fog.color[GGLFormat::BLUE] = (b - (b>>8))>>8; in ggl_fogColor3xv()
292 const int e = (c->state.enables & GGL_ENABLE_FOG)?1:0; in ggl_enable_fog()
294 if (enable) c->state.enables |= GGL_ENABLE_FOG; in ggl_enable_fog()
295 else c->state.enables &= ~GGL_ENABLE_FOG; in ggl_enable_fog()
305 c->state.blend.src = src; in ggl_blendFunc()
306 c->state.blend.src_alpha = src; in ggl_blendFunc()
307 c->state.blend.dst = dst; in ggl_blendFunc()
308 c->state.blend.dst_alpha = dst; in ggl_blendFunc()
309 c->state.blend.alpha_separate = 0; in ggl_blendFunc()
310 if (c->state.enables & GGL_ENABLE_BLENDING) { in ggl_blendFunc()
320 c->state.blend.src = src; in ggl_blendFuncSeparate()
321 c->state.blend.src_alpha = srcAlpha; in ggl_blendFuncSeparate()
322 c->state.blend.dst = dst; in ggl_blendFuncSeparate()
323 c->state.blend.dst_alpha = dstAplha; in ggl_blendFuncSeparate()
324 c->state.blend.alpha_separate = 1; in ggl_blendFuncSeparate()
325 if (c->state.enables & GGL_ENABLE_BLENDING) { in ggl_blendFuncSeparate()
452 texture_t& u = c->state.texture[tmu]; in ggl_texCoordGradScale8xv()
507 c->activeTMU = &(c->state.texture[tmu]); in ggl_activeTexture()
523 if (c->state.mask.color != mask) { in ggl_colorMask()
524 c->state.mask.color = mask; in ggl_colorMask()
532 if (c->state.mask.depth != flag?1:0) { in ggl_depthMask()
533 c->state.mask.depth = flag?1:0; in ggl_depthMask()
541 if (c->state.mask.stencil != mask) { in ggl_stencilMask()
542 c->state.mask.stencil = mask; in ggl_stencilMask()
556 c->state.alpha_test.ref = gglFixedToIteratedColor(gglClampx(ref)); in ggl_alphaFuncx()
557 if (c->state.alpha_test.func != func) { in ggl_alphaFuncx()
558 c->state.alpha_test.func = func; in ggl_alphaFuncx()
572 if (c->state.depth_test.func != func) { in ggl_depthFunc()
573 c->state.depth_test.func = func; in ggl_depthFunc()
587 if (c->state.logic_op.opcode != opcode) { in ggl_logicOp()
588 c->state.logic_op.opcode = opcode; in ggl_logicOp()
598 if (c->state.enables & GGL_ENABLE_SCISSOR_TEST) { in ggl_set_scissor()
599 const int32_t l = c->state.scissor.user_left; in ggl_set_scissor()
600 const int32_t t = c->state.scissor.user_top; in ggl_set_scissor()
601 const int32_t r = c->state.scissor.user_right; in ggl_set_scissor()
602 const int32_t b = c->state.scissor.user_bottom; in ggl_set_scissor()
603 c->state.scissor.left = max(0, l); in ggl_set_scissor()
604 c->state.scissor.right = min(c->state.buffers.color.width, r); in ggl_set_scissor()
605 c->state.scissor.top = max(0, t); in ggl_set_scissor()
606 c->state.scissor.bottom = min(c->state.buffers.color.height, b); in ggl_set_scissor()
608 c->state.scissor.left = 0; in ggl_set_scissor()
609 c->state.scissor.top = 0; in ggl_set_scissor()
610 c->state.scissor.right = c->state.buffers.color.width; in ggl_set_scissor()
611 c->state.scissor.bottom = c->state.buffers.color.height; in ggl_set_scissor()
617 const int e = (c->state.enables & GGL_ENABLE_BLENDING)?1:0; in ggl_enable_blending()
619 if (enable) c->state.enables |= GGL_ENABLE_BLENDING; in ggl_enable_blending()
620 else c->state.enables &= ~GGL_ENABLE_BLENDING; in ggl_enable_blending()
627 const int e = (c->state.enables & GGL_ENABLE_SCISSOR_TEST)?1:0; in ggl_enable_scissor_test()
629 if (enable) c->state.enables |= GGL_ENABLE_SCISSOR_TEST; in ggl_enable_scissor_test()
630 else c->state.enables &= ~GGL_ENABLE_SCISSOR_TEST; in ggl_enable_scissor_test()
637 const int e = (c->state.enables & GGL_ENABLE_ALPHA_TEST)?1:0; in ggl_enable_alpha_test()
639 if (enable) c->state.enables |= GGL_ENABLE_ALPHA_TEST; in ggl_enable_alpha_test()
640 else c->state.enables &= ~GGL_ENABLE_ALPHA_TEST; in ggl_enable_alpha_test()
647 const int e = (c->state.enables & GGL_ENABLE_LOGIC_OP)?1:0; in ggl_enable_logic_op()
649 if (enable) c->state.enables |= GGL_ENABLE_LOGIC_OP; in ggl_enable_logic_op()
650 else c->state.enables &= ~GGL_ENABLE_LOGIC_OP; in ggl_enable_logic_op()
657 const int e = (c->state.enables & GGL_ENABLE_DITHER)?1:0; in ggl_enable_dither()
659 if (enable) c->state.enables |= GGL_ENABLE_DITHER; in ggl_enable_dither()
660 else c->state.enables &= ~GGL_ENABLE_DITHER; in ggl_enable_dither()
671 if (c->state.buffers.depth.format == 0) in ggl_enable_depth_test()
673 const int e = (c->state.enables & GGL_ENABLE_DEPTH_TEST)?1:0; in ggl_enable_depth_test()
675 if (enable) c->state.enables |= GGL_ENABLE_DEPTH_TEST; in ggl_enable_depth_test()
676 else c->state.enables &= ~GGL_ENABLE_DEPTH_TEST; in ggl_enable_depth_test()
683 const int e = (c->state.enables & GGL_ENABLE_AA)?1:0; in ggl_enable_aa()
685 if (enable) c->state.enables |= GGL_ENABLE_AA; in ggl_enable_aa()
686 else c->state.enables &= ~GGL_ENABLE_AA; in ggl_enable_aa()
693 const int e = (c->state.enables & GGL_ENABLE_POINT_AA_NICE)?1:0; in ggl_enable_point_aa_nice()
695 if (enable) c->state.enables |= GGL_ENABLE_POINT_AA_NICE; in ggl_enable_point_aa_nice()
696 else c->state.enables &= ~GGL_ENABLE_POINT_AA_NICE; in ggl_enable_point_aa_nice()
703 const int e = (c->state.enables & GGL_ENABLE_W)?1:0; in ggl_enable_w_lerp()
705 if (enable) c->state.enables |= GGL_ENABLE_W; in ggl_enable_w_lerp()
706 else c->state.enables &= ~GGL_ENABLE_W; in ggl_enable_w_lerp()
717 if (enable) c->state.enabled_tmu |= mask; in ggl_enable_texture2d()
718 else c->state.enabled_tmu &= ~mask; in ggl_enable_texture2d()
719 if (c->state.enabled_tmu) c->state.enables |= GGL_ENABLE_TMUS; in ggl_enable_texture2d()
720 else c->state.enables &= ~GGL_ENABLE_TMUS; in ggl_enable_texture2d()
786 c->state.blend.src = GGL_ONE; in ggl_init_context()
787 c->state.blend.dst = GGL_ZERO; in ggl_init_context()
788 c->state.blend.src_alpha = GGL_ONE; in ggl_init_context()
789 c->state.blend.dst_alpha = GGL_ZERO; in ggl_init_context()
790 c->state.mask.color = 0xF; in ggl_init_context()
791 c->state.mask.depth = 0; in ggl_init_context()
792 c->state.mask.stencil = 0xFFFFFFFF; in ggl_init_context()
793 c->state.logic_op.opcode = GGL_COPY; in ggl_init_context()
794 c->state.alpha_test.func = GGL_ALWAYS; in ggl_init_context()
795 c->state.depth_test.func = GGL_LESS; in ggl_init_context()
796 c->state.depth_test.clearValue = FIXED_ONE; in ggl_init_context()