Lines Matching refs:sf
38 struct nv50_surface *sf = CALLOC_STRUCT(nv50_surface); in nv50_surface_from_buffer() local
39 if (!sf) in nv50_surface_from_buffer()
42 pipe_reference_init(&sf->base.reference, 1); in nv50_surface_from_buffer()
43 pipe_resource_reference(&sf->base.texture, pbuf); in nv50_surface_from_buffer()
45 sf->base.format = templ->format; in nv50_surface_from_buffer()
46 sf->base.usage = templ->usage; in nv50_surface_from_buffer()
47 sf->base.u.buf.first_element = templ->u.buf.first_element; in nv50_surface_from_buffer()
48 sf->base.u.buf.last_element = templ->u.buf.last_element; in nv50_surface_from_buffer()
50 sf->offset = in nv50_surface_from_buffer()
51 templ->u.buf.first_element * util_format_get_blocksize(sf->base.format); in nv50_surface_from_buffer()
53 sf->offset &= ~0x7f; /* FIXME: RT_ADDRESS requires 128 byte alignment */ in nv50_surface_from_buffer()
55 sf->width = templ->u.buf.last_element - templ->u.buf.first_element + 1; in nv50_surface_from_buffer()
56 sf->height = 1; in nv50_surface_from_buffer()
57 sf->depth = 1; in nv50_surface_from_buffer()
59 sf->base.width = sf->width; in nv50_surface_from_buffer()
60 sf->base.height = sf->height; in nv50_surface_from_buffer()
62 sf->base.context = pipe; in nv50_surface_from_buffer()
63 return &sf->base; in nv50_surface_from_buffer()