Lines Matching refs:hwtnl
49 struct svga_hwtnl *hwtnl = CALLOC_STRUCT(svga_hwtnl); in svga_hwtnl_create() local
50 if (hwtnl == NULL) in svga_hwtnl_create()
53 hwtnl->svga = svga; in svga_hwtnl_create()
54 hwtnl->upload_ib = upload_ib; in svga_hwtnl_create()
56 hwtnl->cmd.swc = swc; in svga_hwtnl_create()
58 return hwtnl; in svga_hwtnl_create()
64 void svga_hwtnl_destroy( struct svga_hwtnl *hwtnl ) in svga_hwtnl_destroy() argument
70 pipe_resource_reference( &hwtnl->index_cache[i][j].buffer, in svga_hwtnl_destroy()
75 for (i = 0; i < hwtnl->cmd.vdecl_count; i++) in svga_hwtnl_destroy()
76 pipe_resource_reference(&hwtnl->cmd.vdecl_vb[i], NULL); in svga_hwtnl_destroy()
78 for (i = 0; i < hwtnl->cmd.prim_count; i++) in svga_hwtnl_destroy()
79 pipe_resource_reference(&hwtnl->cmd.prim_ib[i], NULL); in svga_hwtnl_destroy()
82 FREE(hwtnl); in svga_hwtnl_destroy()
86 void svga_hwtnl_set_flatshade( struct svga_hwtnl *hwtnl, in svga_hwtnl_set_flatshade() argument
90 hwtnl->hw_pv = PV_FIRST; in svga_hwtnl_set_flatshade()
91 hwtnl->api_pv = (flatshade && !flatshade_first) ? PV_LAST : PV_FIRST; in svga_hwtnl_set_flatshade()
94 void svga_hwtnl_set_unfilled( struct svga_hwtnl *hwtnl, in svga_hwtnl_set_unfilled() argument
97 hwtnl->api_fillmode = mode; in svga_hwtnl_set_unfilled()
100 void svga_hwtnl_reset_vdecl( struct svga_hwtnl *hwtnl, in svga_hwtnl_reset_vdecl() argument
105 assert(hwtnl->cmd.prim_count == 0); in svga_hwtnl_reset_vdecl()
107 for (i = count; i < hwtnl->cmd.vdecl_count; i++) { in svga_hwtnl_reset_vdecl()
108 pipe_resource_reference(&hwtnl->cmd.vdecl_vb[i], in svga_hwtnl_reset_vdecl()
112 hwtnl->cmd.vdecl_count = count; in svga_hwtnl_reset_vdecl()
116 void svga_hwtnl_vdecl( struct svga_hwtnl *hwtnl, in svga_hwtnl_vdecl() argument
121 assert(hwtnl->cmd.prim_count == 0); in svga_hwtnl_vdecl()
123 assert( i < hwtnl->cmd.vdecl_count ); in svga_hwtnl_vdecl()
125 hwtnl->cmd.vdecl[i] = *decl; in svga_hwtnl_vdecl()
127 pipe_resource_reference(&hwtnl->cmd.vdecl_vb[i], vb); in svga_hwtnl_vdecl()
136 svga_hwtnl_is_buffer_referred( struct svga_hwtnl *hwtnl, in svga_hwtnl_is_buffer_referred() argument
145 if (!hwtnl->cmd.prim_count) { in svga_hwtnl_is_buffer_referred()
149 for (i = 0; i < hwtnl->cmd.vdecl_count; ++i) { in svga_hwtnl_is_buffer_referred()
150 if (hwtnl->cmd.vdecl_vb[i] == buffer) { in svga_hwtnl_is_buffer_referred()
155 for (i = 0; i < hwtnl->cmd.prim_count; ++i) { in svga_hwtnl_is_buffer_referred()
156 if (hwtnl->cmd.prim_ib[i] == buffer) { in svga_hwtnl_is_buffer_referred()
166 svga_hwtnl_flush( struct svga_hwtnl *hwtnl ) in svga_hwtnl_flush() argument
168 struct svga_winsys_context *swc = hwtnl->cmd.swc; in svga_hwtnl_flush()
169 struct svga_context *svga = hwtnl->svga; in svga_hwtnl_flush()
172 if (hwtnl->cmd.prim_count) { in svga_hwtnl_flush()
183 for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { in svga_hwtnl_flush()
184 handle = svga_buffer_handle(svga, hwtnl->cmd.vdecl_vb[i]); in svga_hwtnl_flush()
194 for (i = 0; i < hwtnl->cmd.prim_count; i++) { in svga_hwtnl_flush()
195 if (hwtnl->cmd.prim_ib[i]) { in svga_hwtnl_flush()
196 handle = svga_buffer_handle(svga, hwtnl->cmd.prim_ib[i]); in svga_hwtnl_flush()
223 hwtnl->cmd.prim_count); in svga_hwtnl_flush()
227 hwtnl->cmd.vdecl_count, in svga_hwtnl_flush()
229 hwtnl->cmd.prim_count); in svga_hwtnl_flush()
235 hwtnl->cmd.vdecl, in svga_hwtnl_flush()
236 hwtnl->cmd.vdecl_count * sizeof hwtnl->cmd.vdecl[0]); in svga_hwtnl_flush()
238 for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { in svga_hwtnl_flush()
243 if (hwtnl->cmd.prim_count == 1) { in svga_hwtnl_flush()
244 vdecl[i].rangeHint.first = hwtnl->cmd.min_index[0]; in svga_hwtnl_flush()
245 vdecl[i].rangeHint.last = hwtnl->cmd.max_index[0] + 1; in svga_hwtnl_flush()
259 hwtnl->cmd.prim, in svga_hwtnl_flush()
260 hwtnl->cmd.prim_count * sizeof hwtnl->cmd.prim[0]); in svga_hwtnl_flush()
262 for (i = 0; i < hwtnl->cmd.prim_count; i++) { in svga_hwtnl_flush()
267 pipe_resource_reference(&hwtnl->cmd.prim_ib[i], NULL); in svga_hwtnl_flush()
271 hwtnl->cmd.prim_count = 0; in svga_hwtnl_flush()
278 void svga_hwtnl_set_index_bias( struct svga_hwtnl *hwtnl, in svga_hwtnl_set_index_bias() argument
281 hwtnl->index_bias = index_bias; in svga_hwtnl_set_index_bias()
290 enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl, in svga_hwtnl_prim() argument
301 for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { in svga_hwtnl_prim()
302 struct pipe_resource *vb = hwtnl->cmd.vdecl_vb[i]; in svga_hwtnl_prim()
304 unsigned offset = hwtnl->cmd.vdecl[i].array.offset; in svga_hwtnl_prim()
305 unsigned stride = hwtnl->cmd.vdecl[i].array.stride; in svga_hwtnl_prim()
306 int index_bias = (int) range->indexBias + hwtnl->index_bias; in svga_hwtnl_prim()
314 switch (hwtnl->cmd.vdecl[i].identity.type) { in svga_hwtnl_prim()
424 if (hwtnl->cmd.prim_count+1 >= QSZ) { in svga_hwtnl_prim()
425 ret = svga_hwtnl_flush( hwtnl ); in svga_hwtnl_prim()
431 hwtnl->cmd.min_index[hwtnl->cmd.prim_count] = min_index; in svga_hwtnl_prim()
432 hwtnl->cmd.max_index[hwtnl->cmd.prim_count] = max_index; in svga_hwtnl_prim()
434 hwtnl->cmd.prim[hwtnl->cmd.prim_count] = *range; in svga_hwtnl_prim()
435 hwtnl->cmd.prim[hwtnl->cmd.prim_count].indexBias += hwtnl->index_bias; in svga_hwtnl_prim()
437 pipe_resource_reference(&hwtnl->cmd.prim_ib[hwtnl->cmd.prim_count], ib); in svga_hwtnl_prim()
438 hwtnl->cmd.prim_count++; in svga_hwtnl_prim()