assert(pipeFormat); | assert(pipeFormat); | ||||
cpp = st_sizeof_format(pipeFormat); | cpp = st_sizeof_format(pipeFormat); | ||||
pt = st_texture_create(st, PIPE_TEXTURE_2D, pipeFormat, 0, 0, width, height, | |||||
pt = st_texture_create(st, PIPE_TEXTURE_2D, pipeFormat, 0, width, height, | |||||
1, 0); | 1, 0); | ||||
if (!pt) | if (!pt) | ||||
return NULL; | return NULL; | ||||
/** | /** | ||||
* Create a texture. | * Create a texture. | ||||
*/ | */ | ||||
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, 0, width, height, | |||||
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, width, height, | |||||
1, 0); | 1, 0); | ||||
if (!pt) | if (!pt) | ||||
return NULL; | return NULL; | ||||
psRead = rbRead->surface; | psRead = rbRead->surface; | ||||
format = psRead->format; | format = psRead->format; | ||||
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, 0, width, height, | |||||
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, width, height, | |||||
1, 0); | 1, 0); | ||||
if (!pt) | if (!pt) | ||||
return; | return; |
stObj->pt = st_texture_create(st, | stObj->pt = st_texture_create(st, | ||||
gl_target_to_pipe(stObj->base.Target), | gl_target_to_pipe(stObj->base.Target), | ||||
st_mesa_format_to_pipe_format(stImage->base.TexFormat->MesaFormat), | st_mesa_format_to_pipe_format(stImage->base.TexFormat->MesaFormat), | ||||
firstLevel, | |||||
lastLevel, | lastLevel, | ||||
width, | width, | ||||
height, | height, | ||||
stObj->pt = st_texture_create(ctx->st, | stObj->pt = st_texture_create(ctx->st, | ||||
gl_target_to_pipe(stObj->base.Target), | gl_target_to_pipe(stObj->base.Target), | ||||
st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat), | st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat), | ||||
0, /* first level */ | |||||
stObj->lastLevel, | stObj->lastLevel, | ||||
firstImage->base.Width, | firstImage->base.Width, | ||||
firstImage->base.Height, | firstImage->base.Height, |
* width0, height0, depth0 are the dimensions of the level 0 image | * width0, height0, depth0 are the dimensions of the level 0 image | ||||
* (the highest resolution). last_level indicates how many mipmap levels | * (the highest resolution). last_level indicates how many mipmap levels | ||||
* to allocate storage for. For non-mipmapped textures, this will be zero. | * to allocate storage for. For non-mipmapped textures, this will be zero. | ||||
* XXX first_level obsolete | |||||
*/ | */ | ||||
struct pipe_texture * | struct pipe_texture * | ||||
st_texture_create(struct st_context *st, | st_texture_create(struct st_context *st, | ||||
enum pipe_texture_target target, | enum pipe_texture_target target, | ||||
enum pipe_format format, | enum pipe_format format, | ||||
GLuint first_level, | |||||
GLuint last_level, | GLuint last_level, | ||||
GLuint width0, | GLuint width0, | ||||
GLuint height0, | GLuint height0, | ||||
assert(target <= PIPE_TEXTURE_CUBE); | assert(target <= PIPE_TEXTURE_CUBE); | ||||
DBG("%s target %s format %s level %d..%d\n", __FUNCTION__, | |||||
DBG("%s target %s format %s last_level %d\n", __FUNCTION__, | |||||
_mesa_lookup_enum_by_nr(target), | _mesa_lookup_enum_by_nr(target), | ||||
_mesa_lookup_enum_by_nr(format), first_level, last_level); | |||||
_mesa_lookup_enum_by_nr(format), last_level); | |||||
assert(format); | assert(format); | ||||
st_texture_create(struct st_context *st, | st_texture_create(struct st_context *st, | ||||
enum pipe_texture_target target, | enum pipe_texture_target target, | ||||
enum pipe_format format, | enum pipe_format format, | ||||
GLuint first_level, | |||||
GLuint last_level, | GLuint last_level, | ||||
GLuint width0, | GLuint width0, | ||||
GLuint height0, | GLuint height0, |