void (*Flush)(struct gl_context *ctx, unsigned gallium_flush_flags);
/**
- * Execute glRasterPos, updating the ctx->Current.Raster fields
- */
- void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
-
- /**
- * \name Image-related functions
- */
- /*@{*/
-
- /**
- * Called by glDrawPixels().
- * \p unpack describes how to unpack the source image data.
- */
- void (*DrawPixels)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels );
-
- /**
- * Called by glReadPixels().
- */
- void (*ReadPixels)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- GLvoid *dest );
-
- /**
- * Called by glCopyPixels().
- */
- void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLint dstx, GLint dsty, GLenum type );
-
- /**
- * Called by glBitmap().
- */
- void (*Bitmap)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap );
-
- /**
- * Called by display list code for optimized glCallLists/glBitmap rendering
- * The driver must support texture rectangles of width 1024 or more.
- */
- void (*DrawAtlasBitmaps)(struct gl_context *ctx,
- const struct gl_bitmap_atlas *atlas,
- GLuint count, const GLubyte *ids);
- /*@}*/
-
- /**
* Called by glCopyImageSubData().
*
* This function should copy one 2-D slice from src_teximage or
#include "texobj.h"
#include "state_tracker/st_cb_texture.h"
+#include "state_tracker/st_cb_readpixels.h"
static const char *
tex_target_name(GLenum tgt)
buffer = malloc(rb->Width * rb->Height * 4);
- ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height,
- format, type, &ctx->DefaultPacking, buffer);
+ st_ReadPixels(ctx, 0, 0, rb->Width, rb->Height,
+ format, type, &ctx->DefaultPacking, buffer);
/* make filename */
snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name);
#include "util/u_memory.h"
#include "state_tracker/st_cb_texture.h"
+#include "state_tracker/st_cb_bitmap.h"
#define USE_BITMAP_ATLAS 1
}
if (USE_BITMAP_ATLAS &&
- range > 16 &&
- ctx->Driver.DrawAtlasBitmaps) {
+ range > 16) {
/* "range > 16" is a rough heuristic to guess when glGenLists might be
* used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
* Create the empty atlas now.
if (!USE_BITMAP_ATLAS ||
!ctx->Current.RasterPosValid ||
ctx->List.ListBase == 0 ||
- type != GL_UNSIGNED_BYTE ||
- !ctx->Driver.DrawAtlasBitmaps) {
+ type != GL_UNSIGNED_BYTE) {
/* unsupported */
return false;
}
}
}
- ctx->Driver.DrawAtlasBitmaps(ctx, atlas, n, (const GLubyte *) lists);
+ st_DrawAtlasBitmaps(ctx, atlas, n, (const GLubyte *) lists);
return true;
}
#include "util/u_math.h"
#include "util/rounding.h"
+#include "state_tracker/st_cb_bitmap.h"
+#include "state_tracker/st_cb_drawpixels.h"
/*
* Execute glDrawPixels
}
}
- ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
- &ctx->Unpack, pixels);
+ st_DrawPixels(ctx, x, y, width, height, format, type,
+ &ctx->Unpack, pixels);
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
if (width > 0 && height > 0) {
GLint destx = lroundf(ctx->Current.RasterPos[0]);
GLint desty = lroundf(ctx->Current.RasterPos[1]);
- ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
- type );
+ st_CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
+ type );
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
}
}
- ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
+ st_Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
}
}
else if (ctx->RenderMode == GL_FEEDBACK) {
#include "main/viewport.h"
#include "util/bitscan.h"
-
+#include "state_tracker/st_cb_rasterpos.h"
/**
* Clip a point against the view volume.
/**
- * glRasterPos transformation. Typically called via ctx->Driver.RasterPos().
+ * glRasterPos transformation.
*
* \param vObj vertex position in object space
*/
if (ctx->NewState)
_mesa_update_state( ctx );
- ctx->Driver.RasterPos(ctx, p);
+ st_RasterPos(ctx, p);
}
#include "pixeltransfer.h"
#include "state_tracker/st_cb_fbo.h"
+#include "state_tracker/st_cb_readpixels.h"
/**
* Return true if the conversion L=R+G+B is needed.
/**
- * Software fallback routine for ctx->Driver.ReadPixels().
+ * Software fallback routine.
* By time we get here, all error checking will have been done.
*/
void
if (ctx->Pack.BufferObj)
ctx->Pack.BufferObj->UsageHistory |= USAGE_PIXEL_PACK_BUFFER;
- ctx->Driver.ReadPixels(ctx, x, y, width, height,
- format, type, &clippedPacking, pixels);
+ st_ReadPixels(ctx, x, y, width, height,
+ format, type, &clippedPacking, pixels);
}
void GLAPIENTRY
reset_cache(st);
}
-
-/**
- * Called via ctx->Driver.Bitmap()
- */
-static void
+void
st_Bitmap(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap )
+ const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap)
{
struct st_context *st = st_context(ctx);
struct pipe_resource *pt;
}
}
-
-/**
- * Called via ctx->Driver.DrawAtlasBitmap()
- */
-static void
+void
st_DrawAtlasBitmaps(struct gl_context *ctx,
const struct gl_bitmap_atlas *atlas,
GLuint count, const GLubyte *ids)
st->dirty |= ST_NEW_FS_CONSTANTS;
}
-
-
-/** Per-context init */
-void
-st_init_bitmap_functions(struct dd_function_table *functions)
-{
- functions->Bitmap = st_Bitmap;
- functions->DrawAtlasBitmaps = st_DrawAtlasBitmaps;
-}
-
-
/** Per-context tear-down */
void
st_destroy_bitmap(struct st_context *st)
struct st_context;
struct gl_program;
struct st_program;
-
-extern void
-st_init_bitmap_functions(struct dd_function_table *functions);
+struct gl_bitmap_atlas;
+struct gl_context;
+struct gl_pixelstore_attrib;
extern void
st_destroy_bitmap(struct st_context *st);
unsigned tex_target, unsigned sampler_index,
bool use_texcoord, bool swizzle_xxxx);
+void st_Bitmap(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
+void st_DrawAtlasBitmaps(struct gl_context *ctx,
+ const struct gl_bitmap_atlas *atlas,
+ GLuint count, const GLubyte *ids);
#endif /* ST_CB_BITMAP_H */
*
**************************************************************************/
+#include "main/macros.h"
#include "st_cb_bitmap.h"
#include "tgsi/tgsi_transform.h"
#include "tgsi/tgsi_scan.h"
}
}
-
-/**
- * Called via ctx->Driver.DrawPixels()
- */
-static void
+void
st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
return GL_FALSE;
}
-
-static void
+void
st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
GLsizei width, GLsizei height,
GLint dstx, GLint dsty, GLenum type)
pipe_resource_reference(&pt, NULL);
}
-
-
-void st_init_drawpixels_functions(struct dd_function_table *functions)
-{
- functions->DrawPixels = st_DrawPixels;
- functions->CopyPixels = st_CopyPixels;
-}
-
-
void
st_destroy_drawpix(struct st_context *st)
{
struct dd_function_table;
struct st_context;
+struct gl_context;
+struct gl_pixelstore_attrib;
-extern void st_init_drawpixels_functions(struct dd_function_table *functions);
extern void
st_destroy_drawpix(struct st_context *st);
extern void
st_make_passthrough_vertex_shader(struct st_context *st);
+void st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack, const void *pixels);
+void st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type);
+
#endif /* ST_CB_DRAWPIXELS_H */
*
**************************************************************************/
+#include "main/macros.h"
#include "st_cb_drawpixels.h"
#include "tgsi/tgsi_transform.h"
#include "tgsi/tgsi_scan.h"
}
-static void
+void
st_RasterPos(struct gl_context *ctx, const GLfloat v[4])
{
struct st_context *st = st_context(ctx);
draw_set_rasterize_stage(draw, st->selection_stage);
}
}
-
-
-
-void st_init_rasterpos_functions(struct dd_function_table *functions)
-{
- functions->RasterPos = st_RasterPos;
-}
#ifndef ST_CB_RASTERPOS_H
#define ST_CB_RASTERPOS_H
-
-struct dd_function_table;
-
-extern void st_init_rasterpos_functions(struct dd_function_table *functions);
-
+void st_RasterPos(struct gl_context *ctx, const GLfloat v[4]);
#endif /* ST_CB_RASTERPOS_H */
* texture layouts during texture uploads/downloads, so the blit
* we do here should be free in such cases.
*/
-static void
+void
st_ReadPixels(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
fallback:
_mesa_readpixels(ctx, x, y, width, height, format, type, pack, pixels);
}
-
-void st_init_readpixels_functions(struct dd_function_table *functions)
-{
- functions->ReadPixels = st_ReadPixels;
-}
#include "main/glheader.h"
-struct dd_function_table;
-
-extern void
-st_init_readpixels_functions(struct dd_function_table *functions);
-
+void
+st_ReadPixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ void *pixels);
#endif /* ST_CB_READPIXELS_H */
#include "st_cb_condrender.h"
#include "st_cb_copyimage.h"
#include "st_cb_drawpixels.h"
-#include "st_cb_rasterpos.h"
#include "st_cb_drawtex.h"
#include "st_cb_eglimage.h"
#include "st_cb_feedback.h"
#include "st_cb_perfquery.h"
#include "st_cb_program.h"
#include "st_cb_queryobj.h"
-#include "st_cb_readpixels.h"
#include "st_cb_flush.h"
#include "st_cb_viewport.h"
#include "st_atom.h"
st_init_draw_functions(screen, functions);
st_init_blit_functions(functions);
st_init_bufferobject_functions(screen, functions);
- st_init_bitmap_functions(functions);
st_init_copy_image_functions(functions);
- st_init_drawpixels_functions(functions);
- st_init_rasterpos_functions(functions);
st_init_drawtex_functions(functions);
st_init_msaa_functions(functions);
st_init_program_functions(functions);
- st_init_readpixels_functions(functions);
st_init_flush_functions(screen, functions);
st_init_viewport_functions(functions);
st_init_compute_functions(functions);