mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
mesa/st: move map/unmap renderbuffer code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
This commit is contained in:
parent
90e4e7cf74
commit
b70b738bd1
6 changed files with 133 additions and 138 deletions
|
|
@ -29,14 +29,12 @@
|
|||
#include "format_unpack.h"
|
||||
#include "format_pack.h"
|
||||
#include "framebuffer.h"
|
||||
|
||||
#include "renderbuffer.h"
|
||||
#include "macros.h"
|
||||
#include "state.h"
|
||||
#include "mtypes.h"
|
||||
#include "api_exec_decl.h"
|
||||
|
||||
#include "state_tracker/st_cb_fbo.h"
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
|
||||
{
|
||||
|
|
@ -84,7 +82,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx)
|
|||
width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
|
||||
height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
|
||||
|
||||
st_MapRenderbuffer(ctx, accRb, x, y, width, height,
|
||||
_mesa_map_renderbuffer(ctx, accRb, x, y, width, height,
|
||||
GL_MAP_WRITE_BIT, &accMap, &accRowStride,
|
||||
ctx->DrawBuffer->FlipY);
|
||||
|
||||
|
|
@ -117,7 +115,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx)
|
|||
_mesa_warning(ctx, "unexpected accum buffer type");
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, accRb);
|
||||
_mesa_unmap_renderbuffer(ctx, accRb);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -139,7 +137,7 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value,
|
|||
|
||||
assert(accRb);
|
||||
|
||||
st_MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
_mesa_map_renderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
|
||||
&accMap, &accRowStride,
|
||||
ctx->DrawBuffer->FlipY);
|
||||
|
|
@ -176,7 +174,7 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value,
|
|||
/* other types someday? */
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, accRb);
|
||||
_mesa_unmap_renderbuffer(ctx, accRb);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -210,7 +208,7 @@ accum_or_load(struct gl_context *ctx, GLfloat value,
|
|||
mappingFlags |= GL_MAP_READ_BIT;
|
||||
|
||||
/* Map accum buffer */
|
||||
st_MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
_mesa_map_renderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
mappingFlags, &accMap, &accRowStride,
|
||||
ctx->DrawBuffer->FlipY);
|
||||
if (!accMap) {
|
||||
|
|
@ -219,12 +217,12 @@ accum_or_load(struct gl_context *ctx, GLfloat value,
|
|||
}
|
||||
|
||||
/* Map color buffer */
|
||||
st_MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height,
|
||||
_mesa_map_renderbuffer(ctx, colorRb, xpos, ypos, width, height,
|
||||
GL_MAP_READ_BIT,
|
||||
&colorMap, &colorRowStride,
|
||||
ctx->DrawBuffer->FlipY);
|
||||
if (!colorMap) {
|
||||
st_UnmapRenderbuffer(ctx, accRb);
|
||||
_mesa_unmap_renderbuffer(ctx, accRb);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
|
||||
return;
|
||||
}
|
||||
|
|
@ -274,8 +272,8 @@ accum_or_load(struct gl_context *ctx, GLfloat value,
|
|||
/* other types someday? */
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, accRb);
|
||||
st_UnmapRenderbuffer(ctx, colorRb);
|
||||
_mesa_unmap_renderbuffer(ctx, accRb);
|
||||
_mesa_unmap_renderbuffer(ctx, colorRb);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -293,7 +291,7 @@ accum_return(struct gl_context *ctx, GLfloat value,
|
|||
GLuint buffer;
|
||||
|
||||
/* Map accum buffer */
|
||||
st_MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
_mesa_map_renderbuffer(ctx, accRb, xpos, ypos, width, height,
|
||||
GL_MAP_READ_BIT,
|
||||
&accMap, &accRowStride, fb->FlipY);
|
||||
if (!accMap) {
|
||||
|
|
@ -314,7 +312,7 @@ accum_return(struct gl_context *ctx, GLfloat value,
|
|||
mappingFlags |= GL_MAP_READ_BIT;
|
||||
|
||||
/* Map color buffer */
|
||||
st_MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height,
|
||||
_mesa_map_renderbuffer(ctx, colorRb, xpos, ypos, width, height,
|
||||
mappingFlags, &colorMap, &colorRowStride,
|
||||
fb->FlipY);
|
||||
if (!colorMap) {
|
||||
|
|
@ -382,10 +380,10 @@ accum_return(struct gl_context *ctx, GLfloat value,
|
|||
/* other types someday? */
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, colorRb);
|
||||
_mesa_unmap_renderbuffer(ctx, colorRb);
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, accRb);
|
||||
_mesa_unmap_renderbuffer(ctx, accRb);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "pack.h"
|
||||
#include "pbo.h"
|
||||
#include "pixel.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "state.h"
|
||||
#include "glformats.h"
|
||||
#include "fbobject.h"
|
||||
|
|
@ -244,7 +245,7 @@ readpixels_memcpy(struct gl_context *ctx,
|
|||
dst = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
|
||||
format, type, 0, 0);
|
||||
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &stride, ctx->ReadBuffer->FlipY);
|
||||
if (!map) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -265,7 +266,7 @@ readpixels_memcpy(struct gl_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +296,7 @@ read_uint_depth_pixels( struct gl_context *ctx,
|
|||
if (_mesa_get_format_datatype(rb->Format) != GL_UNSIGNED_NORMALIZED)
|
||||
return GL_FALSE;
|
||||
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &stride, fb->FlipY);
|
||||
|
||||
if (!map) {
|
||||
|
|
@ -313,7 +314,7 @@ read_uint_depth_pixels( struct gl_context *ctx,
|
|||
map += stride;
|
||||
dst += dstStride;
|
||||
}
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
@ -353,7 +354,7 @@ read_depth_pixels( struct gl_context *ctx,
|
|||
dst = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
|
||||
GL_DEPTH_COMPONENT, type, 0, 0);
|
||||
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &stride, fb->FlipY);
|
||||
if (!map) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -378,7 +379,7 @@ read_depth_pixels( struct gl_context *ctx,
|
|||
|
||||
free(depthValues);
|
||||
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -401,7 +402,7 @@ read_stencil_pixels( struct gl_context *ctx,
|
|||
if (!rb)
|
||||
return;
|
||||
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &stride, fb->FlipY);
|
||||
if (!map) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -430,7 +431,7 @@ read_stencil_pixels( struct gl_context *ctx,
|
|||
|
||||
free(stencil);
|
||||
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -472,7 +473,7 @@ read_rgba_pixels( struct gl_context *ctx,
|
|||
format, type, 0, 0);
|
||||
|
||||
/* Map the source render buffer */
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &rb_stride, fb->FlipY);
|
||||
if (!map) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -636,7 +637,7 @@ done_swap:
|
|||
}
|
||||
|
||||
done_unmap:
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -662,7 +663,7 @@ fast_read_depth_stencil_pixels(struct gl_context *ctx,
|
|||
rb->Format != MESA_FORMAT_Z24_UNORM_S8_UINT)
|
||||
return GL_FALSE;
|
||||
|
||||
st_MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
_mesa_map_renderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,
|
||||
&map, &stride, fb->FlipY);
|
||||
if (!map) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -676,7 +677,7 @@ fast_read_depth_stencil_pixels(struct gl_context *ctx,
|
|||
dst += dstStride;
|
||||
}
|
||||
|
||||
st_UnmapRenderbuffer(ctx, rb);
|
||||
_mesa_unmap_renderbuffer(ctx, rb);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
@ -702,17 +703,17 @@ fast_read_depth_stencil_pixels_separate(struct gl_context *ctx,
|
|||
if (_mesa_get_format_datatype(depthRb->Format) != GL_UNSIGNED_NORMALIZED)
|
||||
return GL_FALSE;
|
||||
|
||||
st_MapRenderbuffer(ctx, depthRb, x, y, width, height,
|
||||
_mesa_map_renderbuffer(ctx, depthRb, x, y, width, height,
|
||||
GL_MAP_READ_BIT, &depthMap, &depthStride, fb->FlipY);
|
||||
if (!depthMap) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
return GL_TRUE; /* don't bother trying the slow path */
|
||||
}
|
||||
|
||||
st_MapRenderbuffer(ctx, stencilRb, x, y, width, height,
|
||||
_mesa_map_renderbuffer(ctx, stencilRb, x, y, width, height,
|
||||
GL_MAP_READ_BIT, &stencilMap, &stencilStride, fb->FlipY);
|
||||
if (!stencilMap) {
|
||||
st_UnmapRenderbuffer(ctx, depthRb);
|
||||
_mesa_unmap_renderbuffer(ctx, depthRb);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
return GL_TRUE; /* don't bother trying the slow path */
|
||||
}
|
||||
|
|
@ -740,8 +741,8 @@ fast_read_depth_stencil_pixels_separate(struct gl_context *ctx,
|
|||
|
||||
free(stencilVals);
|
||||
|
||||
st_UnmapRenderbuffer(ctx, depthRb);
|
||||
st_UnmapRenderbuffer(ctx, stencilRb);
|
||||
_mesa_unmap_renderbuffer(ctx, depthRb);
|
||||
_mesa_unmap_renderbuffer(ctx, stencilRb);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
@ -766,7 +767,7 @@ slow_read_depth_stencil_pixels_separate(struct gl_context *ctx,
|
|||
/* The depth and stencil buffers might be separate, or a single buffer.
|
||||
* If one buffer, only map it once.
|
||||
*/
|
||||
st_MapRenderbuffer(ctx, depthRb, x, y, width, height,
|
||||
_mesa_map_renderbuffer(ctx, depthRb, x, y, width, height,
|
||||
GL_MAP_READ_BIT, &depthMap, &depthStride, fb->FlipY);
|
||||
if (!depthMap) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
|
|
@ -774,11 +775,11 @@ slow_read_depth_stencil_pixels_separate(struct gl_context *ctx,
|
|||
}
|
||||
|
||||
if (stencilRb != depthRb) {
|
||||
st_MapRenderbuffer(ctx, stencilRb, x, y, width, height,
|
||||
_mesa_map_renderbuffer(ctx, stencilRb, x, y, width, height,
|
||||
GL_MAP_READ_BIT, &stencilMap,
|
||||
&stencilStride, fb->FlipY);
|
||||
if (!stencilMap) {
|
||||
st_UnmapRenderbuffer(ctx, depthRb);
|
||||
_mesa_unmap_renderbuffer(ctx, depthRb);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
|
||||
return;
|
||||
}
|
||||
|
|
@ -812,9 +813,9 @@ slow_read_depth_stencil_pixels_separate(struct gl_context *ctx,
|
|||
free(stencilVals);
|
||||
free(depthVals);
|
||||
|
||||
st_UnmapRenderbuffer(ctx, depthRb);
|
||||
_mesa_unmap_renderbuffer(ctx, depthRb);
|
||||
if (stencilRb != depthRb) {
|
||||
st_UnmapRenderbuffer(ctx, stencilRb);
|
||||
_mesa_unmap_renderbuffer(ctx, stencilRb);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "glheader.h"
|
||||
|
||||
#include "context.h"
|
||||
#include "bufferobj.h"
|
||||
#include "fbobject.h"
|
||||
#include "formats.h"
|
||||
#include "glformats.h"
|
||||
|
|
@ -425,3 +426,85 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
|
|||
|
||||
*ptr = rb;
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_map_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint x, GLuint y, GLuint w, GLuint h,
|
||||
GLbitfield mode,
|
||||
GLubyte **mapOut, GLint *rowStrideOut,
|
||||
bool flip_y)
|
||||
{
|
||||
struct pipe_context *pipe = ctx->pipe;
|
||||
const GLboolean invert = flip_y;
|
||||
GLuint y2;
|
||||
GLubyte *map;
|
||||
|
||||
if (rb->software) {
|
||||
/* software-allocated renderbuffer (probably an accum buffer) */
|
||||
if (rb->data) {
|
||||
GLint bpp = _mesa_get_format_bytes(rb->Format);
|
||||
GLint stride = _mesa_format_row_stride(rb->Format,
|
||||
rb->Width);
|
||||
*mapOut = (GLubyte *) rb->data + y * stride + x * bpp;
|
||||
*rowStrideOut = stride;
|
||||
}
|
||||
else {
|
||||
*mapOut = NULL;
|
||||
*rowStrideOut = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for unexpected flags */
|
||||
assert((mode & ~(GL_MAP_READ_BIT |
|
||||
GL_MAP_WRITE_BIT |
|
||||
GL_MAP_INVALIDATE_RANGE_BIT)) == 0);
|
||||
|
||||
const enum pipe_map_flags transfer_flags =
|
||||
_mesa_access_flags_to_transfer_flags(mode, false);
|
||||
|
||||
/* Note: y=0=bottom of buffer while y2=0=top of buffer.
|
||||
* 'invert' will be true for window-system buffers and false for
|
||||
* user-allocated renderbuffers and textures.
|
||||
*/
|
||||
if (invert)
|
||||
y2 = rb->Height - y - h;
|
||||
else
|
||||
y2 = y;
|
||||
|
||||
map = pipe_texture_map(pipe,
|
||||
rb->texture,
|
||||
rb->surface->u.tex.level,
|
||||
rb->surface->u.tex.first_layer,
|
||||
transfer_flags, x, y2, w, h, &rb->transfer);
|
||||
if (map) {
|
||||
if (invert) {
|
||||
*rowStrideOut = -(int) rb->transfer->stride;
|
||||
map += (h - 1) * rb->transfer->stride;
|
||||
}
|
||||
else {
|
||||
*rowStrideOut = rb->transfer->stride;
|
||||
}
|
||||
*mapOut = map;
|
||||
}
|
||||
else {
|
||||
*mapOut = NULL;
|
||||
*rowStrideOut = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_unmap_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb)
|
||||
{
|
||||
struct pipe_context *pipe = ctx->pipe;
|
||||
|
||||
if (rb->software) {
|
||||
/* software-allocated renderbuffer (probably an accum buffer) */
|
||||
return;
|
||||
}
|
||||
|
||||
pipe_texture_unmap(pipe, rb->transfer);
|
||||
rb->transfer = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,19 @@ _mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
|
|||
if (*ptr != rb)
|
||||
_mesa_reference_renderbuffer_(ptr, rb);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_map_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint x, GLuint y, GLuint w, GLuint h,
|
||||
GLbitfield mode,
|
||||
GLubyte **mapOut, GLint *rowStrideOut,
|
||||
bool flip_y);
|
||||
|
||||
void
|
||||
_mesa_unmap_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -319,94 +319,3 @@ st_update_renderbuffer_surface(struct st_context *st,
|
|||
}
|
||||
rb->surface = *psurf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called via ctx->Driver.MapRenderbuffer.
|
||||
*/
|
||||
void
|
||||
st_MapRenderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint x, GLuint y, GLuint w, GLuint h,
|
||||
GLbitfield mode,
|
||||
GLubyte **mapOut, GLint *rowStrideOut,
|
||||
bool flip_y)
|
||||
{
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_context *pipe = st->pipe;
|
||||
const GLboolean invert = flip_y;
|
||||
GLuint y2;
|
||||
GLubyte *map;
|
||||
|
||||
if (rb->software) {
|
||||
/* software-allocated renderbuffer (probably an accum buffer) */
|
||||
if (rb->data) {
|
||||
GLint bpp = _mesa_get_format_bytes(rb->Format);
|
||||
GLint stride = _mesa_format_row_stride(rb->Format,
|
||||
rb->Width);
|
||||
*mapOut = (GLubyte *) rb->data + y * stride + x * bpp;
|
||||
*rowStrideOut = stride;
|
||||
}
|
||||
else {
|
||||
*mapOut = NULL;
|
||||
*rowStrideOut = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for unexpected flags */
|
||||
assert((mode & ~(GL_MAP_READ_BIT |
|
||||
GL_MAP_WRITE_BIT |
|
||||
GL_MAP_INVALIDATE_RANGE_BIT)) == 0);
|
||||
|
||||
const enum pipe_map_flags transfer_flags =
|
||||
_mesa_access_flags_to_transfer_flags(mode, false);
|
||||
|
||||
/* Note: y=0=bottom of buffer while y2=0=top of buffer.
|
||||
* 'invert' will be true for window-system buffers and false for
|
||||
* user-allocated renderbuffers and textures.
|
||||
*/
|
||||
if (invert)
|
||||
y2 = rb->Height - y - h;
|
||||
else
|
||||
y2 = y;
|
||||
|
||||
map = pipe_texture_map(pipe,
|
||||
rb->texture,
|
||||
rb->surface->u.tex.level,
|
||||
rb->surface->u.tex.first_layer,
|
||||
transfer_flags, x, y2, w, h, &rb->transfer);
|
||||
if (map) {
|
||||
if (invert) {
|
||||
*rowStrideOut = -(int) rb->transfer->stride;
|
||||
map += (h - 1) * rb->transfer->stride;
|
||||
}
|
||||
else {
|
||||
*rowStrideOut = rb->transfer->stride;
|
||||
}
|
||||
*mapOut = map;
|
||||
}
|
||||
else {
|
||||
*mapOut = NULL;
|
||||
*rowStrideOut = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called via ctx->Driver.UnmapRenderbuffer.
|
||||
*/
|
||||
void
|
||||
st_UnmapRenderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb)
|
||||
{
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_context *pipe = st->pipe;
|
||||
|
||||
if (rb->software) {
|
||||
/* software-allocated renderbuffer (probably an accum buffer) */
|
||||
return;
|
||||
}
|
||||
|
||||
pipe_texture_unmap(pipe, rb->transfer);
|
||||
rb->transfer = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,4 @@ extern void
|
|||
st_regen_renderbuffer_surface(struct st_context *st,
|
||||
struct gl_renderbuffer *strb);
|
||||
|
||||
void st_MapRenderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint x, GLuint y, GLuint w, GLuint h,
|
||||
GLbitfield mode,
|
||||
GLubyte **mapOut, GLint *rowStrideOut,
|
||||
bool flip_y);
|
||||
void st_UnmapRenderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb);
|
||||
#endif /* ST_CB_FBO_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue