Lines Matching defs:strb
69 struct st_renderbuffer *strb = st_renderbuffer(rb);
73 free(strb->data);
74 strb->data = NULL;
95 strb->Base.Format = st_pipe_format_to_mesa_format(format);
97 size = _mesa_format_image_size(strb->Base.Format, width, height, 1);
98 strb->data = malloc(size);
99 return strb->data != NULL;
117 struct st_renderbuffer *strb = st_renderbuffer(rb);
123 strb->Base.Width = width;
124 strb->Base.Height = height;
125 strb->Base._BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
126 strb->defined = GL_FALSE; /* undefined contents now */
128 if (strb->software) {
135 pipe_surface_reference( &strb->surface, NULL );
136 pipe_resource_reference( &strb->texture, NULL );
183 strb->Base.Format = st_pipe_format_to_mesa_format(format);
203 else if (strb->Base.Name != 0) {
213 strb->texture = screen->resource_create(screen, &templ);
215 if (!strb->texture)
218 u_surface_default_template(&surf_tmpl, strb->texture);
219 strb->surface = pipe->create_surface(pipe,
220 strb->texture,
222 if (strb->surface) {
223 assert(strb->surface->texture);
224 assert(strb->surface->format);
225 assert(strb->surface->width == width);
226 assert(strb->surface->height == height);
229 return strb->surface != NULL;
239 struct st_renderbuffer *strb = st_renderbuffer(rb);
242 pipe_surface_release(st->pipe, &strb->surface);
244 pipe_resource_reference(&strb->texture, NULL);
245 free(strb->data);
256 struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
257 if (strb) {
259 _mesa_init_renderbuffer(&strb->Base, name);
260 strb->Base.Delete = st_renderbuffer_delete;
261 strb->Base.AllocStorage = st_renderbuffer_alloc_storage;
262 return &strb->Base;
275 struct st_renderbuffer *strb;
277 strb = ST_CALLOC_STRUCT(st_renderbuffer);
278 if (!strb) {
283 _mesa_init_renderbuffer(&strb->Base, 0);
284 strb->Base.ClassID = 0x4242; /* just a unique value */
285 strb->Base.NumSamples = samples;
286 strb->Base.Format = st_pipe_format_to_mesa_format(format);
287 strb->Base._BaseFormat = _mesa_get_format_base_format(strb->Base.Format);
288 strb->software = sw;
294 strb->Base.InternalFormat = GL_RGBA8;
299 strb->Base.InternalFormat = GL_RGB8;
304 strb->Base.InternalFormat = GL_SRGB8_ALPHA8;
309 strb->Base.InternalFormat = GL_SRGB8;
312 strb->Base.InternalFormat = GL_RGB5_A1;
315 strb->Base.InternalFormat = GL_RGBA4;
318 strb->Base.InternalFormat = GL_RGB565;
321 strb->Base.InternalFormat = GL_DEPTH_COMPONENT16;
324 strb->Base.InternalFormat = GL_DEPTH_COMPONENT32;
328 strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT;
332 strb->Base.InternalFormat = GL_DEPTH_COMPONENT24;
335 strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT;
339 strb->Base.InternalFormat = GL_RGBA16_SNORM;
342 strb->Base.InternalFormat = GL_RGBA16;
345 strb->Base.InternalFormat = GL_R8;
348 strb->Base.InternalFormat = GL_RG8;
351 strb->Base.InternalFormat = GL_R16;
354 strb->Base.InternalFormat = GL_RG16;
357 strb->Base.InternalFormat = GL_RGBA32F;
360 strb->Base.InternalFormat = GL_RGBA16F;
366 free(strb);
371 strb->Base.Delete = st_renderbuffer_delete;
372 strb->Base.AllocStorage = st_renderbuffer_alloc_storage;
375 strb->surface = NULL;
377 return &strb->Base;
387 struct st_renderbuffer *strb)
390 struct pipe_resource *resource = strb->texture;
392 unsigned rtt_width = strb->Base.Width;
393 unsigned rtt_height = strb->Base.Height;
394 unsigned rtt_depth = strb->Base.Depth;
397 * the format of strb->texture is linear (because we have no control over
398 * the format). Check strb->Base.Format instead of strb->texture->format
402 _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB);
405 if (strb->is_rtt) {
406 stTexObj = st_texture_object(strb->Base.TexImage->TexObject);
434 if (strb->rtt_layered) {
436 last_layer = util_max_layer(strb->texture, level);
440 last_layer = strb->rtt_face + strb->rtt_slice;
444 if (strb->is_rtt && resource->array_size > 1 &&
448 if (!strb->rtt_layered)
454 if (!strb->surface ||
455 strb->surface->texture->nr_samples != strb->Base.NumSamples ||
456 strb->surface->format != format ||
457 strb->surface->texture != resource ||
458 strb->surface->width != rtt_width ||
459 strb->surface->height != rtt_height ||
460 strb->surface->u.tex.level != level ||
461 strb->surface->u.tex.first_layer != first_layer ||
462 strb->surface->u.tex.last_layer != last_layer) {
471 pipe_surface_release(pipe, &strb->surface);
473 strb->surface = pipe->create_surface(pipe, resource, &surf_tmpl);
488 struct st_renderbuffer *strb = st_renderbuffer(rb);
498 strb->is_rtt = TRUE;
499 strb->rtt_face = att->CubeMapFace;
500 strb->rtt_slice = att->Zoffset;
501 strb->rtt_layered = att->Layered;
502 pipe_resource_reference(&strb->texture, pt);
504 st_update_renderbuffer_surface(st, strb);
527 struct st_renderbuffer *strb = st_renderbuffer(rb);
529 if (!strb)
532 strb->is_rtt = FALSE;
754 struct st_renderbuffer *strb = st_renderbuffer(rb);
761 if (strb->software) {
763 if (strb->data) {
764 GLint bpp = _mesa_get_format_bytes(strb->Base.Format);
765 GLint stride = _mesa_format_row_stride(strb->Base.Format,
766 strb->Base.Width);
767 *mapOut = (GLubyte *) strb->data + y * stride + x * bpp;
790 y2 = strb->Base.Height - y - h;
795 strb->texture,
796 strb->surface->u.tex.level,
797 strb->surface->u.tex.first_layer,
798 usage, x, y2, w, h, &strb->transfer);
801 *rowStrideOut = -(int) strb->transfer->stride;
802 map += (h - 1) * strb->transfer->stride;
805 *rowStrideOut = strb->transfer->stride;
824 struct st_renderbuffer *strb = st_renderbuffer(rb);
827 if (strb->software) {
832 pipe_transfer_unmap(pipe, strb->transfer);
833 strb->transfer = NULL;