#include "state_tracker/st_debug.h"
#include "state_tracker/st_context.h"
#include "state_tracker/st_cb_fbo.h"
#include "state_tracker/st_debug.h"
#include "state_tracker/st_context.h"
#include "state_tracker/st_cb_fbo.h"
#include "state_tracker/st_cb_texture.h"
#include "state_tracker/st_format.h"
#include "state_tracker/st_texture.h"
#include "state_tracker/st_gen_mipmap.h"
#include "state_tracker/st_cb_texture.h"
#include "state_tracker/st_format.h"
#include "state_tracker/st_texture.h"
#include "state_tracker/st_gen_mipmap.h"
*
* We use the given st_texture_image as a clue to determine the size of the
* mipmap image at level=0.
*
* We use the given st_texture_image as a clue to determine the size of the
* mipmap image at level=0.
guess_and_alloc_texture(struct st_context *st,
struct st_texture_object *stObj,
const struct st_texture_image *stImage)
guess_and_alloc_texture(struct st_context *st,
struct st_texture_object *stObj,
const struct st_texture_image *stImage)
(dims >= 3 && depth == 1) ) {
/* we can't determine the image size at level=0 */
stObj->width0 = stObj->height0 = stObj->depth0 = 0;
(dims >= 3 && depth == 1) ) {
/* we can't determine the image size at level=0 */
stObj->width0 = stObj->height0 = stObj->depth0 = 0;
- DBG("%s - success\n", __FUNCTION__);
+ DBG("%s returning %d\n", __FUNCTION__, (stObj->pt != NULL));
+
+ return stObj->pt != NULL;
0, 0, 0, /* face, level are zero */
PIPE_TRANSFER_WRITE,
0, 0, width, height); /* x, y, w, h */
0, 0, 0, /* face, level are zero */
PIPE_TRANSFER_WRITE,
0, 0, width, height); /* x, y, w, h */
/* Probably out of memory.
* Try flushing any pending rendering, then retry.
*/
st_finish(st);
/* Probably out of memory.
* Try flushing any pending rendering, then retry.
*/
st_finish(st);
/* Image is stored in hardware format in a buffer managed by the
* kernel. Need to explicitly map and unmap it.
*/
/* Image is stored in hardware format in a buffer managed by the
* kernel. Need to explicitly map and unmap it.
*/
texImage->Data = st_texture_image_map(st, stImage, 0,
PIPE_TRANSFER_READ, 0, 0,
stImage->base.Width,
texImage->Data = st_texture_image_map(st, stImage, 0,
PIPE_TRANSFER_READ, 0, 0,
stImage->base.Width,
if (format == GL_DEPTH_COMPONENT &&
util_format_is_depth_and_stencil(stImage->pt->format))
transfer_usage = PIPE_TRANSFER_READ_WRITE;
else
transfer_usage = PIPE_TRANSFER_WRITE;
if (format == GL_DEPTH_COMPONENT &&
util_format_is_depth_and_stencil(stImage->pt->format))
transfer_usage = PIPE_TRANSFER_READ_WRITE;
else
transfer_usage = PIPE_TRANSFER_WRITE;
texImage->Data = st_texture_image_map(st, stImage, zoffset,
transfer_usage,
xoffset, yoffset,
texImage->Data = st_texture_image_map(st, stImage, zoffset,
transfer_usage,
xoffset, yoffset,
texImage->Data = st_texture_image_map(st, stImage, 0,
PIPE_TRANSFER_WRITE,
xoffset, yoffset,
texImage->Data = st_texture_image_map(st, stImage, 0,
PIPE_TRANSFER_WRITE,
xoffset, yoffset,
texDest = st_texture_image_map(st, stImage, 0, transfer_usage,
destX, destY, width, height);
texDest = st_texture_image_map(st, stImage, 0, transfer_usage,
destX, destY, width, height);
struct pipe_surface *dest_surface = NULL;
GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP);
struct pipe_surface *dest_surface = NULL;
GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP);
*/
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
*/
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
stImage->face);
pipe_resource_reference(&stImage->pt, NULL);
}
else if (stImage->base.Data) {
stImage->face);
pipe_resource_reference(&stImage->pt, NULL);
}
else if (stImage->base.Data) {
GLboolean
st_finalize_texture(GLcontext *ctx,
struct pipe_context *pipe,
GLboolean
st_finalize_texture(GLcontext *ctx,
struct pipe_context *pipe,
if (stObj->base._Complete) {
/* The texture is complete and we know exactly how many mipmap levels
* are present/needed. This is conditional because we may be called
if (stObj->base._Complete) {
/* The texture is complete and we know exactly how many mipmap levels
* are present/needed. This is conditional because we may be called
*/
if (stImage && stObj->pt != stImage->pt) {
copy_image_data_to_texture(st, stObj, level, stImage);
*/
if (stImage && stObj->pt != stImage->pt) {
copy_image_data_to_texture(st, stObj, level, stImage);