Lines Matching refs:rb
211 get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, in get_z32_values() argument
215 struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); in get_z32_values()
216 const GLint w = rb->Width, h = rb->Height; in get_z32_values()
217 const GLubyte *map = _swrast_pixel_address(rb, 0, 0); in get_z32_values()
220 if (rb->Format == MESA_FORMAT_Z_UNORM32) { in get_z32_values()
229 const GLint bpp = _mesa_get_format_bytes(rb->Format); in get_z32_values()
234 _mesa_unpack_uint_z_row(rb->Format, 1, src, &zbuffer[i]); in get_z32_values()
332 put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, in put_z32_values() argument
336 struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); in put_z32_values()
337 const GLint w = rb->Width, h = rb->Height; in put_z32_values()
338 GLubyte *map = _swrast_pixel_address(rb, 0, 0); in put_z32_values()
341 if (rb->Format == MESA_FORMAT_Z_UNORM32) { in put_z32_values()
351 mesa_pack_uint_z_func packZ = get_pack_uint_z_func(rb->Format); in put_z32_values()
352 const GLint bpp = _mesa_get_format_bytes(rb->Format); in put_z32_values()
372 struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; in _swrast_depth_test_span() local
373 const GLint bpp = _mesa_get_format_bytes(rb->Format); in _swrast_depth_test_span()
381 GLuint zBits = _mesa_get_format_bits(rb->Format, GL_DEPTH_BITS); in _swrast_depth_test_span()
387 zStart = _swrast_pixel_address(rb, span->x, span->y); in _swrast_depth_test_span()
389 if (rb->Format == MESA_FORMAT_Z_UNORM16 && !(span->arrayMask & SPAN_XY)) { in _swrast_depth_test_span()
394 else if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) { in _swrast_depth_test_span()
405 get_z32_values(ctx, rb, count, in _swrast_depth_test_span()
409 _mesa_unpack_uint_z_row(rb->Format, count, zStart, zBufferTemp); in _swrast_depth_test_span()
463 put_z32_values(ctx, rb, count, span->array->x, span->array->y, in _swrast_depth_test_span()
468 mesa_pack_uint_z_func packZ = get_pack_uint_z_func(rb->Format); in _swrast_depth_test_span()
500 struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; in _swrast_depth_bounds_test() local
520 zStart = _swrast_pixel_address(rb, span->x, span->y); in _swrast_depth_bounds_test()
522 if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) { in _swrast_depth_bounds_test()
528 if (rb->Format == MESA_FORMAT_Z_UNORM16) { in _swrast_depth_bounds_test()
539 get_z32_values(ctx, rb, count, span->array->x, span->array->y, in _swrast_depth_bounds_test()
543 _mesa_unpack_uint_z_row(rb->Format, count, zStart, zBufferTemp); in _swrast_depth_bounds_test()
578 struct gl_renderbuffer *rb, in _swrast_read_depth_span_float() argument
581 if (!rb) { in _swrast_read_depth_span_float()
587 if (y < 0 || y >= (GLint) rb->Height || in _swrast_read_depth_span_float()
588 x + n <= 0 || x >= (GLint) rb->Width) { in _swrast_read_depth_span_float()
603 if (x + n > (GLint) rb->Width) { in _swrast_read_depth_span_float()
604 GLint dx = x + n - (GLint) rb->Width; in _swrast_read_depth_span_float()
614 _mesa_unpack_float_z_row(rb->Format, n, _swrast_pixel_address(rb, x, y), in _swrast_read_depth_span_float()
626 struct gl_renderbuffer *rb = in _swrast_clear_depth_buffer() local
633 if (!rb || !ctx->Depth.Mask) { in _swrast_clear_depth_buffer()
645 if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT || in _swrast_clear_depth_buffer()
646 rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT || in _swrast_clear_depth_buffer()
647 rb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM || in _swrast_clear_depth_buffer()
648 rb->Format == MESA_FORMAT_X8_UINT_Z24_UNORM) { in _swrast_clear_depth_buffer()
652 ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, in _swrast_clear_depth_buffer()
660 switch (rb->Format) { in _swrast_clear_depth_buffer()
665 _mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal); in _swrast_clear_depth_buffer()
686 _mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal); in _swrast_clear_depth_buffer()
705 if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT || in _swrast_clear_depth_buffer()
706 rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT) in _swrast_clear_depth_buffer()
711 _mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal); in _swrast_clear_depth_buffer()
738 _mesa_get_format_name(rb->Format)); in _swrast_clear_depth_buffer()
741 ctx->Driver.UnmapRenderbuffer(ctx, rb); in _swrast_clear_depth_buffer()
756 struct gl_renderbuffer *rb = in _swrast_clear_depth_stencil_buffer() local
764 assert(rb == ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer); in _swrast_clear_depth_stencil_buffer()
778 ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, in _swrast_clear_depth_stencil_buffer()
786 switch (rb->Format) { in _swrast_clear_depth_stencil_buffer()
793 _mesa_pack_float_z_row(rb->Format, 1, &zClear, &clear); in _swrast_clear_depth_stencil_buffer()
795 if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) { in _swrast_clear_depth_stencil_buffer()
849 _mesa_get_format_name(rb->Format)); in _swrast_clear_depth_stencil_buffer()
852 ctx->Driver.UnmapRenderbuffer(ctx, rb); in _swrast_clear_depth_stencil_buffer()