}
/* Get true format */
- This->format_conversion = d3d9_to_pipe_format_checked(This->base.info.screen,
+ This->format_internal = d3d9_to_pipe_format_checked(This->base.info.screen,
pDesc->Format,
This->base.info.target,
This->base.info.nr_samples,
This->base.info.bind,
FALSE,
TRUE);
- if (This->base.info.format != This->format_conversion) {
- This->data_conversion = align_calloc(
- nine_format_get_level_alloc_size(This->format_conversion,
+ if (This->base.info.format != This->format_internal) {
+ This->data_internal = align_calloc(
+ nine_format_get_level_alloc_size(This->format_internal,
pDesc->Width,
pDesc->Height,
0), 32);
- if (!This->data_conversion)
+ if (!This->data_internal)
return E_OUTOFMEMORY;
- This->stride_conversion = nine_format_get_stride(This->format_conversion,
+ This->stride_internal = nine_format_get_stride(This->format_internal,
pDesc->Width);
}
/* Release system memory when we have to manage it (no parent) */
if (!This->base.base.container && This->data)
align_free(This->data);
- if (This->data_conversion)
- align_free(This->data_conversion);
+ if (This->data_internal)
+ align_free(This->data_internal);
NineResource9_dtor(&This->base);
}
if (p_atomic_read(&This->pending_uploads_counter))
nine_csmt_process(This->base.base.device);
- if (This->data_conversion) {
+ if (This->data_internal) {
/* For now we only have uncompressed formats here */
- pLockedRect->Pitch = This->stride_conversion;
- pLockedRect->pBits = This->data_conversion + box.y * This->stride_conversion +
- util_format_get_stride(This->format_conversion, box.x);
+ pLockedRect->Pitch = This->stride_internal;
+ pLockedRect->pBits = This->data_internal + box.y * This->stride_internal +
+ util_format_get_stride(This->format_internal, box.x);
} else if (This->data) {
DBG("returning system memory\n");
/* ATI1 and ATI2 need special handling, because of d3d9 bug.
}
--This->lock_count;
- if (This->data_conversion) {
+ if (This->data_internal) {
if (This->data) {
(void) util_format_translate(This->base.info.format,
This->data, This->stride,
0, 0,
- This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
+ This->format_internal,
+ This->data_internal,
+ This->stride_internal,
0, 0,
This->desc.Width, This->desc.Height);
} else {
This->base.resource,
This->level,
&dst_box,
- This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
+ This->format_internal,
+ This->data_internal,
+ This->stride_internal,
0, /* depth = 1 */
&src_box);
}
nine_csmt_process(This->base.base.device);
}
- if (This->data_conversion)
- (void) util_format_translate(This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
+ if (This->data_internal)
+ (void) util_format_translate(This->format_internal,
+ This->data_internal,
+ This->stride_internal,
dst_x, dst_y,
From->base.info.format,
From->data, From->stride,
D3DSURFACE_DESC desc;
uint8_t *data; /* system memory backing */
- uint8_t *data_conversion; /* for conversions */
- enum pipe_format format_conversion;
+ uint8_t *data_internal; /* for conversions */
+ enum pipe_format format_internal;
unsigned stride; /* for system memory backing */
- unsigned stride_conversion;
+ unsigned stride_internal;
unsigned pending_uploads_counter; /* pending uploads */
};
This->stride, pDesc->Height);
/* Get true format */
- This->format_conversion = d3d9_to_pipe_format_checked(This->info.screen,
+ This->format_internal = d3d9_to_pipe_format_checked(This->info.screen,
pDesc->Format,
This->info.target,
This->info.nr_samples,
This->info.bind, FALSE,
TRUE);
- if (This->info.format != This->format_conversion) {
- This->stride_conversion = nine_format_get_stride(This->format_conversion,
+ if (This->info.format != This->format_internal) {
+ This->stride_internal = nine_format_get_stride(This->format_internal,
pDesc->Width);
- This->layer_stride_conversion = util_format_get_2d_size(This->format_conversion,
- This->stride_conversion,
+ This->layer_stride_internal = util_format_get_2d_size(This->format_internal,
+ This->stride_internal,
pDesc->Height);
- This->data_conversion = align_calloc(This->layer_stride_conversion *
+ This->data_internal = align_calloc(This->layer_stride_internal *
This->desc.Depth, 32);
- if (!This->data_conversion)
+ if (!This->data_internal)
return E_OUTOFMEMORY;
}
if (This->data)
align_free(This->data);
- if (This->data_conversion)
- align_free(This->data_conversion);
+ if (This->data_internal)
+ align_free(This->data_internal);
pipe_resource_reference(&This->resource, NULL);
if (p_atomic_read(&This->pending_uploads_counter))
nine_csmt_process(This->base.device);
- if (This->data_conversion) {
+ if (This->data_internal) {
/* For now we only have uncompressed formats here */
- pLockedVolume->RowPitch = This->stride_conversion;
- pLockedVolume->SlicePitch = This->layer_stride_conversion;
- pLockedVolume->pBits = This->data_conversion + box.z * This->layer_stride_conversion +
- box.y * This->stride_conversion +
- util_format_get_stride(This->format_conversion, box.x);
+ pLockedVolume->RowPitch = This->stride_internal;
+ pLockedVolume->SlicePitch = This->layer_stride_internal;
+ pLockedVolume->pBits = This->data_internal + box.z * This->layer_stride_internal +
+ box.y * This->stride_internal +
+ util_format_get_stride(This->format_internal, box.x);
} else if (This->data) {
pLockedVolume->RowPitch = This->stride;
pLockedVolume->SlicePitch = This->layer_stride;
}
--This->lock_count;
- if (This->data_conversion) {
+ if (This->data_internal) {
struct pipe_box box;
u_box_3d(0, 0, 0, This->desc.Width, This->desc.Height, This->desc.Depth,
This->data, This->stride,
This->layer_stride,
0, 0, 0,
- This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
- This->layer_stride_conversion,
+ This->format_internal,
+ This->data_internal,
+ This->stride_internal,
+ This->layer_stride_internal,
0, 0, 0,
This->desc.Width, This->desc.Height,
This->desc.Depth);
This->resource,
This->level,
&box,
- This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
- This->layer_stride_conversion,
+ This->format_internal,
+ This->data_internal,
+ This->stride_internal,
+ This->layer_stride_internal,
&box);
}
}
From->layer_stride,
&src_box);
- if (This->data_conversion)
- (void) util_format_translate_3d(This->format_conversion,
- This->data_conversion,
- This->stride_conversion,
- This->layer_stride_conversion,
+ if (This->data_internal)
+ (void) util_format_translate_3d(This->format_internal,
+ This->data_internal,
+ This->stride_internal,
+ This->layer_stride_internal,
dstx, dsty, dstz,
From->info.format,
From->data, From->stride,
unsigned level_actual;
uint8_t *data; /* system memory backing */
- uint8_t *data_conversion; /* for conversions */
+ uint8_t *data_internal; /* for conversions */
D3DVOLUME_DESC desc;
struct pipe_resource info;
- enum pipe_format format_conversion;
+ enum pipe_format format_internal;
unsigned stride;
- unsigned stride_conversion;
+ unsigned stride_internal;
unsigned layer_stride;
- unsigned layer_stride_conversion;
+ unsigned layer_stride_internal;
struct pipe_transfer *transfer;
unsigned lock_count;