- memset(&template, 0, sizeof(template));
- template.target = PIPE_TEXTURE_2D;
- template.format = PIPE_FORMAT_B8G8R8X8_UNORM;
- template.last_level = 0;
- template.width0 = reply->width;
- template.height0 = reply->height;
- template.depth0 = 1;
- template.array_size = 1;
- template.usage = PIPE_USAGE_DEFAULT;
- template.bind = PIPE_BIND_RENDER_TARGET;
- template.flags = 0;
-
- tex = scrn->base.pscreen->resource_from_handle(scrn->base.pscreen, &template, &dri2_handle);
+ memset(&templ, 0, sizeof(templ));
+ templ.target = PIPE_TEXTURE_2D;
+ templ.format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ templ.last_level = 0;
+ templ.width0 = reply->width;
+ templ.height0 = reply->height;
+ templ.depth0 = 1;
+ templ.array_size = 1;
+ templ.usage = PIPE_USAGE_DEFAULT;
+ templ.bind = PIPE_BIND_RENDER_TARGET;
+ templ.flags = 0;
+
+ tex = scrn->base.pscreen->resource_from_handle(scrn->base.pscreen, &templ,
+ &dri2_handle,
+ PIPE_HANDLE_USAGE_READ_WRITE);