• Home
  • Raw
  • Download

Lines Matching refs:This

38 NineVolume9_AllocateData( struct NineVolume9 *This )  in NineVolume9_AllocateData()  argument
40 unsigned size = This->layer_stride * This->desc.Depth; in NineVolume9_AllocateData()
43 This->base.container, This, This->level, size); in NineVolume9_AllocateData()
45 This->data = (uint8_t *)align_calloc(size, 32); in NineVolume9_AllocateData()
46 if (!This->data) in NineVolume9_AllocateData()
52 NineVolume9_ctor( struct NineVolume9 *This, in NineVolume9_ctor() argument
64 This, pContainer, pParams->device, pResource, Level, pDesc); in NineVolume9_ctor()
74 hr = NineUnknown_ctor(&This->base, pParams); in NineVolume9_ctor()
78 pipe_resource_reference(&This->resource, pResource); in NineVolume9_ctor()
80 This->transfer = NULL; in NineVolume9_ctor()
81 This->lock_count = 0; in NineVolume9_ctor()
83 This->level = Level; in NineVolume9_ctor()
84 This->level_actual = Level; in NineVolume9_ctor()
85 This->desc = *pDesc; in NineVolume9_ctor()
87 This->info.screen = pParams->device->screen; in NineVolume9_ctor()
88 This->info.target = PIPE_TEXTURE_3D; in NineVolume9_ctor()
89 This->info.width0 = pDesc->Width; in NineVolume9_ctor()
90 This->info.height0 = pDesc->Height; in NineVolume9_ctor()
91 This->info.depth0 = pDesc->Depth; in NineVolume9_ctor()
92 This->info.last_level = 0; in NineVolume9_ctor()
93 This->info.array_size = 1; in NineVolume9_ctor()
94 This->info.nr_samples = 0; in NineVolume9_ctor()
95 This->info.nr_storage_samples = 0; in NineVolume9_ctor()
96 This->info.usage = PIPE_USAGE_DEFAULT; in NineVolume9_ctor()
97 This->info.bind = PIPE_BIND_SAMPLER_VIEW; in NineVolume9_ctor()
98 This->info.flags = 0; in NineVolume9_ctor()
99 This->info.format = d3d9_to_pipe_format_checked(This->info.screen, in NineVolume9_ctor()
101 This->info.target, in NineVolume9_ctor()
102 This->info.nr_samples, in NineVolume9_ctor()
103 This->info.bind, FALSE, in NineVolume9_ctor()
106 if (This->info.format == PIPE_FORMAT_NONE) in NineVolume9_ctor()
109 This->stride = util_format_get_stride(This->info.format, pDesc->Width); in NineVolume9_ctor()
110 This->stride = align(This->stride, 4); in NineVolume9_ctor()
111 This->layer_stride = util_format_get_2d_size(This->info.format, in NineVolume9_ctor()
112 This->stride, pDesc->Height); in NineVolume9_ctor()
115 This->format_internal = d3d9_to_pipe_format_checked(This->info.screen, in NineVolume9_ctor()
117 This->info.target, in NineVolume9_ctor()
118 This->info.nr_samples, in NineVolume9_ctor()
119 This->info.bind, FALSE, in NineVolume9_ctor()
121 if (This->info.format != This->format_internal || in NineVolume9_ctor()
125 This->stride_internal = nine_format_get_stride(This->format_internal, in NineVolume9_ctor()
127 This->layer_stride_internal = util_format_get_2d_size(This->format_internal, in NineVolume9_ctor()
128 This->stride_internal, in NineVolume9_ctor()
130 This->data_internal = align_calloc(This->layer_stride_internal * in NineVolume9_ctor()
131 This->desc.Depth, 32); in NineVolume9_ctor()
132 if (!This->data_internal) in NineVolume9_ctor()
136 if (!This->resource) { in NineVolume9_ctor()
137 hr = NineVolume9_AllocateData(This); in NineVolume9_ctor()
145 NineVolume9_dtor( struct NineVolume9 *This ) in NineVolume9_dtor() argument
147 DBG("This=%p\n", This); in NineVolume9_dtor()
149 if (This->transfer) { in NineVolume9_dtor()
150 struct pipe_context *pipe = nine_context_get_pipe_multithread(This->base.device); in NineVolume9_dtor()
151 pipe->texture_unmap(pipe, This->transfer); in NineVolume9_dtor()
152 This->transfer = NULL; in NineVolume9_dtor()
158 if (p_atomic_read(&This->pending_uploads_counter)) in NineVolume9_dtor()
159 nine_csmt_process(This->base.device); in NineVolume9_dtor()
161 if (This->data) in NineVolume9_dtor()
162 align_free(This->data); in NineVolume9_dtor()
163 if (This->data_internal) in NineVolume9_dtor()
164 align_free(This->data_internal); in NineVolume9_dtor()
166 pipe_resource_reference(&This->resource, NULL); in NineVolume9_dtor()
168 NineUnknown_dtor(&This->base); in NineVolume9_dtor()
172 NineVolume9_GetContainer( struct NineVolume9 *This, in NineVolume9_GetContainer() argument
179 This, riid, riid ? GUID_sprintf(guid_str, riid) : "", ppContainer); in NineVolume9_GetContainer()
183 if (!NineUnknown(This)->container) in NineVolume9_GetContainer()
185 return NineUnknown_QueryInterface(NineUnknown(This)->container, riid, ppContainer); in NineVolume9_GetContainer()
189 NineVolume9_MarkContainerDirty( struct NineVolume9 *This ) in NineVolume9_MarkContainerDirty() argument
196 assert(NineUnknown_QueryInterface(This->base.container, ref, (void **)&tex) in NineVolume9_MarkContainerDirty()
201 tex = NineBaseTexture9(This->base.container); in NineVolume9_MarkContainerDirty()
203 if (This->desc.Pool == D3DPOOL_MANAGED) in NineVolume9_MarkContainerDirty()
210 NineVolume9_GetDesc( struct NineVolume9 *This, in NineVolume9_GetDesc() argument
214 *pDesc = This->desc; in NineVolume9_GetDesc()
219 NineVolume9_AddDirtyRegion( struct NineVolume9 *This, in NineVolume9_AddDirtyRegion() argument
223 struct NineVolumeTexture9 *tex = NineVolumeTexture9(This->base.container); in NineVolume9_AddDirtyRegion()
228 dirty_region.Left = box->x << This->level_actual; in NineVolume9_AddDirtyRegion()
229 dirty_region.Top = box->y << This->level_actual; in NineVolume9_AddDirtyRegion()
230 dirty_region.Front = box->z << This->level_actual; in NineVolume9_AddDirtyRegion()
231 dirty_region.Right = dirty_region.Left + (box->width << This->level_actual); in NineVolume9_AddDirtyRegion()
232 dirty_region.Bottom = dirty_region.Top + (box->height << This->level_actual); in NineVolume9_AddDirtyRegion()
233 dirty_region.Back = dirty_region.Front + (box->depth << This->level_actual); in NineVolume9_AddDirtyRegion()
251 NineVolume9_LockBox( struct NineVolume9 *This, in NineVolume9_LockBox() argument
257 struct pipe_resource *resource = This->resource; in NineVolume9_LockBox()
262 This, This->base.container, pLockedVolume, pBox, in NineVolume9_LockBox()
269 user_assert(This->lock_count == 0, D3DERR_INVALIDCALL); in NineVolume9_LockBox()
275 user_assert(This->desc.Pool != D3DPOOL_DEFAULT || in NineVolume9_LockBox()
276 (This->desc.Usage & D3DUSAGE_DYNAMIC), D3DERR_INVALIDCALL); in NineVolume9_LockBox()
281 if (pBox && compressed_format (This->desc.Format)) { /* For volume all pools are checked */ in NineVolume9_LockBox()
282 const unsigned w = util_format_get_blockwidth(This->info.format); in NineVolume9_LockBox()
283 const unsigned h = util_format_get_blockheight(This->info.format); in NineVolume9_LockBox()
284 user_assert((pBox->Left == 0 && pBox->Right == This->desc.Width && in NineVolume9_LockBox()
285 pBox->Top == 0 && pBox->Bottom == This->desc.Height) || in NineVolume9_LockBox()
304 user_assert(pBox->Right <= This->desc.Width, D3DERR_INVALIDCALL); in NineVolume9_LockBox()
305 user_assert(pBox->Bottom <= This->desc.Height, D3DERR_INVALIDCALL); in NineVolume9_LockBox()
306 user_assert(pBox->Back <= This->desc.Depth, D3DERR_INVALIDCALL); in NineVolume9_LockBox()
309 if (u_box_clip_2d(&box, &box, This->desc.Width, This->desc.Height) < 0) { in NineVolume9_LockBox()
314 u_box_3d(0, 0, 0, This->desc.Width, This->desc.Height, This->desc.Depth, in NineVolume9_LockBox()
318 if (p_atomic_read(&This->pending_uploads_counter)) in NineVolume9_LockBox()
319 nine_csmt_process(This->base.device); in NineVolume9_LockBox()
321 if (This->data_internal || This->data) { in NineVolume9_LockBox()
322 enum pipe_format format = This->info.format; in NineVolume9_LockBox()
323 unsigned stride = This->stride; in NineVolume9_LockBox()
324 unsigned layer_stride = This->layer_stride; in NineVolume9_LockBox()
325 uint8_t *data = This->data; in NineVolume9_LockBox()
326 if (This->data_internal) { in NineVolume9_LockBox()
327 format = This->format_internal; in NineVolume9_LockBox()
328 stride = This->stride_internal; in NineVolume9_LockBox()
329 layer_stride = This->layer_stride_internal; in NineVolume9_LockBox()
330 data = This->data_internal; in NineVolume9_LockBox()
339 bool no_refs = !p_atomic_read(&This->base.bind) && in NineVolume9_LockBox()
340 !p_atomic_read(&This->base.container->bind); in NineVolume9_LockBox()
342 pipe = nine_context_get_pipe_acquire(This->base.device); in NineVolume9_LockBox()
344 pipe = NineDevice9_GetPipe(This->base.device); in NineVolume9_LockBox()
346 pipe->texture_map(pipe, resource, This->level, usage, in NineVolume9_LockBox()
347 &box, &This->transfer); in NineVolume9_LockBox()
349 nine_context_get_pipe_release(This->base.device); in NineVolume9_LockBox()
350 if (!This->transfer) { in NineVolume9_LockBox()
355 pLockedVolume->RowPitch = This->transfer->stride; in NineVolume9_LockBox()
356 pLockedVolume->SlicePitch = This->transfer->layer_stride; in NineVolume9_LockBox()
360 NineVolume9_MarkContainerDirty(This); in NineVolume9_LockBox()
361 NineVolume9_AddDirtyRegion(This, &box); in NineVolume9_LockBox()
364 ++This->lock_count; in NineVolume9_LockBox()
369 NineVolume9_UnlockBox( struct NineVolume9 *This ) in NineVolume9_UnlockBox() argument
373 DBG("This=%p lock_count=%u\n", This, This->lock_count); in NineVolume9_UnlockBox()
374 user_assert(This->lock_count, D3DERR_INVALIDCALL); in NineVolume9_UnlockBox()
375 if (This->transfer) { in NineVolume9_UnlockBox()
376 pipe = nine_context_get_pipe_acquire(This->base.device); in NineVolume9_UnlockBox()
377 pipe->texture_unmap(pipe, This->transfer); in NineVolume9_UnlockBox()
378 This->transfer = NULL; in NineVolume9_UnlockBox()
379 nine_context_get_pipe_release(This->base.device); in NineVolume9_UnlockBox()
381 --This->lock_count; in NineVolume9_UnlockBox()
383 if (This->data_internal) { in NineVolume9_UnlockBox()
386 u_box_3d(0, 0, 0, This->desc.Width, This->desc.Height, This->desc.Depth, in NineVolume9_UnlockBox()
390 if (This->data) { in NineVolume9_UnlockBox()
391 (void) util_format_translate_3d(This->info.format, in NineVolume9_UnlockBox()
392 This->data, This->stride, in NineVolume9_UnlockBox()
393 This->layer_stride, in NineVolume9_UnlockBox()
395 This->format_internal, in NineVolume9_UnlockBox()
396 This->data_internal, in NineVolume9_UnlockBox()
397 This->stride_internal, in NineVolume9_UnlockBox()
398 This->layer_stride_internal, in NineVolume9_UnlockBox()
400 This->desc.Width, This->desc.Height, in NineVolume9_UnlockBox()
401 This->desc.Depth); in NineVolume9_UnlockBox()
403 nine_context_box_upload(This->base.device, in NineVolume9_UnlockBox()
404 &This->pending_uploads_counter, in NineVolume9_UnlockBox()
405 (struct NineUnknown *)This, in NineVolume9_UnlockBox()
406 This->resource, in NineVolume9_UnlockBox()
407 This->level, in NineVolume9_UnlockBox()
409 This->format_internal, in NineVolume9_UnlockBox()
410 This->data_internal, in NineVolume9_UnlockBox()
411 This->stride_internal, in NineVolume9_UnlockBox()
412 This->layer_stride_internal, in NineVolume9_UnlockBox()
423 NineVolume9_CopyMemToDefault( struct NineVolume9 *This, in NineVolume9_CopyMemToDefault() argument
428 struct pipe_resource *r_dst = This->resource; in NineVolume9_CopyMemToDefault()
433 This, From, dstx, dsty, dstz, pSrcBox); in NineVolume9_CopyMemToDefault()
435 assert(This->desc.Pool == D3DPOOL_DEFAULT && in NineVolume9_CopyMemToDefault()
457 nine_context_box_upload(This->base.device, in NineVolume9_CopyMemToDefault()
461 This->level, in NineVolume9_CopyMemToDefault()
468 if (This->data_internal) in NineVolume9_CopyMemToDefault()
469 (void) util_format_translate_3d(This->format_internal, in NineVolume9_CopyMemToDefault()
470 This->data_internal, in NineVolume9_CopyMemToDefault()
471 This->stride_internal, in NineVolume9_CopyMemToDefault()
472 This->layer_stride_internal, in NineVolume9_CopyMemToDefault()
483 NineVolume9_MarkContainerDirty(This); in NineVolume9_CopyMemToDefault()
489 NineVolume9_UploadSelf( struct NineVolume9 *This, in NineVolume9_UploadSelf() argument
492 struct pipe_resource *res = This->resource; in NineVolume9_UploadSelf()
495 DBG("This=%p damaged=%p data=%p res=%p\n", This, damaged, in NineVolume9_UploadSelf()
496 This->data, res); in NineVolume9_UploadSelf()
498 assert(This->desc.Pool == D3DPOOL_MANAGED); in NineVolume9_UploadSelf()
507 box.width = This->desc.Width; in NineVolume9_UploadSelf()
508 box.height = This->desc.Height; in NineVolume9_UploadSelf()
509 box.depth = This->desc.Depth; in NineVolume9_UploadSelf()
512 nine_context_box_upload(This->base.device, in NineVolume9_UploadSelf()
513 &This->pending_uploads_counter, in NineVolume9_UploadSelf()
514 (struct NineUnknown *)This, in NineVolume9_UploadSelf()
516 This->level, in NineVolume9_UploadSelf()
519 This->data, This->stride, in NineVolume9_UploadSelf()
520 This->layer_stride, in NineVolume9_UploadSelf()