#include "util/u_box.h"
#include "util/u_debug.h"
#include "util/u_format.h"
+#include "util/u_inlines.h"
#include "util/u_memory.h"
#include "postprocess/filters.h"
unsigned i;
/* Find the z/stencil buffer if there is one */
- for (i = 0; i < Elements(osbuffer->textures); i++) {
+ for (i = 0; i < ARRAY_SIZE(osbuffer->textures); i++) {
struct pipe_resource *res = osbuffer->textures[i];
if (res) {
const struct util_format_description *desc =
templat.format = format;
templat.bind = bind;
+ pipe_resource_reference(&out[i], NULL);
out[i] = osbuffer->textures[statts[i]] =
screen->resource_create(screen, &templat);
}
return TRUE;
}
+static uint32_t osmesa_fb_ID = 0;
static struct st_framebuffer_iface *
osmesa_create_st_framebuffer(void)
stfbi->flush_front = osmesa_st_framebuffer_flush_front;
stfbi->validate = osmesa_st_framebuffer_validate;
p_atomic_set(&stfbi->stamp, 1);
+ stfbi->ID = p_atomic_inc_return(&osmesa_fb_ID);
+ stfbi->state_manager = get_st_manager();
}
return stfbi;
}
static void
osmesa_destroy_buffer(struct osmesa_buffer *osbuffer)
{
+ struct st_api *stapi = get_st_api();
+
+ /*
+ * Notify the state manager that the associated framebuffer interface
+ * is no longer valid.
+ */
+ stapi->destroy_drawable(stapi, osbuffer->stfb);
+
FREE(osbuffer->stfb);
FREE(osbuffer);
}
attribs.options.disable_blend_func_extended = FALSE;
attribs.options.disable_glsl_line_continuations = FALSE;
attribs.options.disable_shader_bit_encoding = FALSE;
- attribs.options.force_s3tc_enable = FALSE;
attribs.options.force_glsl_version = 0;
osmesa_init_st_visual(&attribs.visual,
boolean any_pp_enabled = FALSE;
unsigned i;
- for (i = 0; i < Elements(osmesa->pp_enabled); i++) {
+ for (i = 0; i < ARRAY_SIZE(osmesa->pp_enabled); i++) {
if (osmesa->pp_enabled[i]) {
any_pp_enabled = TRUE;
break;
int maxLevels = screen->get_param(screen,
PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
*value = 1 << (maxLevels - 1);
- *value = 8 * 1024;
}
return;
default: