* @param[in] height region height
* @param[in] flip_y set if y coords of the source image need to be flipped
*/
-GLboolean r300_blit(struct r300_context *r300,
- struct radeon_bo *src_bo,
- intptr_t src_offset,
- gl_format src_mesaformat,
- unsigned src_pitch,
- unsigned src_width,
- unsigned src_height,
- unsigned src_x_offset,
- unsigned src_y_offset,
- struct radeon_bo *dst_bo,
- intptr_t dst_offset,
- gl_format dst_mesaformat,
- unsigned dst_pitch,
- unsigned dst_width,
- unsigned dst_height,
- unsigned dst_x_offset,
- unsigned dst_y_offset,
- unsigned reg_width,
- unsigned reg_height,
- unsigned flip_y)
+unsigned r300_blit(GLcontext *ctx,
+ struct radeon_bo *src_bo,
+ intptr_t src_offset,
+ gl_format src_mesaformat,
+ unsigned src_pitch,
+ unsigned src_width,
+ unsigned src_height,
+ unsigned src_x_offset,
+ unsigned src_y_offset,
+ struct radeon_bo *dst_bo,
+ intptr_t dst_offset,
+ gl_format dst_mesaformat,
+ unsigned dst_pitch,
+ unsigned dst_width,
+ unsigned dst_height,
+ unsigned dst_x_offset,
+ unsigned dst_y_offset,
+ unsigned reg_width,
+ unsigned reg_height,
+ unsigned flip_y)
{
+ r300ContextPtr r300 = R300_CONTEXT(ctx);
+
if (_mesa_get_format_bits(src_mesaformat, GL_DEPTH_BITS) > 0)
- return GL_FALSE;
+ return 0;
/* Make sure that colorbuffer has even width - hw limitation */
if (dst_pitch % 2 > 0)
* Looks like a hw limitation.
*/
if (dst_pitch < 32)
- return GL_FALSE;
+ return 0;
/* Need to clamp the region size to make sure
* we don't read outside of the source buffer
reg_height = dst_height - dst_y_offset;
if (src_bo == dst_bo) {
- return GL_FALSE;
+ return 0;
}
if (0) {
radeonFlush(r300->radeon.glCtx);
if (!validate_buffers(r300, src_bo, dst_bo))
- return GL_FALSE;
+ return 0;
rcommonEnsureCmdBufSpace(&r300->radeon, 200, __FUNCTION__);
radeonFlush(r300->radeon.glCtx);
- return GL_TRUE;
-}
\ No newline at end of file
+ return 1;
+}
void r300_blit_init(struct r300_context *r300);
-GLboolean r300_blit(struct r300_context *r300,
- struct radeon_bo *src_bo,
- intptr_t src_offset,
- gl_format src_mesaformat,
- unsigned src_pitch,
- unsigned src_width,
- unsigned src_height,
- unsigned src_x_offset,
- unsigned src_y_offset,
- struct radeon_bo *dst_bo,
- intptr_t dst_offset,
- gl_format dst_mesaformat,
- unsigned dst_pitch,
- unsigned dst_width,
- unsigned dst_height,
- unsigned dst_x_offset,
- unsigned dst_y_offset,
- unsigned width,
- unsigned height,
- unsigned flip_y);
+unsigned r300_blit(GLcontext *ctx,
+ struct radeon_bo *src_bo,
+ intptr_t src_offset,
+ gl_format src_mesaformat,
+ unsigned src_pitch,
+ unsigned src_width,
+ unsigned src_height,
+ unsigned src_x_offset,
+ unsigned src_y_offset,
+ struct radeon_bo *dst_bo,
+ intptr_t dst_offset,
+ gl_format dst_mesaformat,
+ unsigned dst_pitch,
+ unsigned dst_width,
+ unsigned dst_height,
+ unsigned dst_x_offset,
+ unsigned dst_y_offset,
+ unsigned reg_width,
+ unsigned reg_height,
+ unsigned flip_y);
#endif // R300_BLIT_H
\ No newline at end of file
radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z;
} else
radeon->vtbl.emit_query_finish = r300_emit_query_finish;
+
+ radeon->vtbl.blit = r300_blit;
}
static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
#include "drivers/common/meta.h"
#include "radeon_mipmap_tree.h"
-#include "r300_blit.h"
#include <main/debug.h>
// TODO:
}
/* blit from src buffer to texture */
- return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp,
+ return r300->radeon.vtbl.blit(ctx, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp,
rrb->base.Width, rrb->base.Height, x, y,
timg->mt->bo, dst_offset, timg->base.TexFormat,
timg->base.Width, timg->base.Width, timg->base.Height,