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