summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/indexbuffer9.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-02 16:24:39 +0200
committerMarek Olšák <[email protected]>2017-05-10 19:00:16 +0200
commit330d0607ed60fd3edca192e54b4246310f06652f (patch)
tree56bceba5b291ffcf42209ef1ab7ec515a8f5b666 /src/gallium/state_trackers/nine/indexbuffer9.c
parent22f6624ed318e8131681ec1f2e7b3a59449df412 (diff)
gallium: remove pipe_index_buffer and set_index_buffer
pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
Diffstat (limited to 'src/gallium/state_trackers/nine/indexbuffer9.c')
-rw-r--r--src/gallium/state_trackers/nine/indexbuffer9.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/nine/indexbuffer9.c b/src/gallium/state_trackers/nine/indexbuffer9.c
index cbd75fb928c..d5f5492563d 100644
--- a/src/gallium/state_trackers/nine/indexbuffer9.c
+++ b/src/gallium/state_trackers/nine/indexbuffer9.c
@@ -49,17 +49,16 @@ NineIndexBuffer9_ctor( struct NineIndexBuffer9 *This,
if (FAILED(hr))
return hr;
- This->buffer.buffer = NULL;
- This->buffer.offset = 0;
+ This->buffer = NULL;
+ This->offset = 0;
switch (pDesc->Format) {
- case D3DFMT_INDEX16: This->buffer.index_size = 2; break;
- case D3DFMT_INDEX32: This->buffer.index_size = 4; break;
+ case D3DFMT_INDEX16: This->index_size = 2; break;
+ case D3DFMT_INDEX32: This->index_size = 4; break;
default:
user_assert(!"Invalid index format.", D3DERR_INVALIDCALL);
break;
}
- This->buffer.user_buffer = NULL;
pDesc->Type = D3DRTYPE_INDEXBUFFER;
This->desc = *pDesc;
@@ -73,12 +72,12 @@ NineIndexBuffer9_dtor( struct NineIndexBuffer9 *This )
NineBuffer9_dtor(&This->base);
}
-const struct pipe_index_buffer *
+struct pipe_resource *
NineIndexBuffer9_GetBuffer( struct NineIndexBuffer9 *This )
{
/* The resource may change */
- This->buffer.buffer = NineBuffer9_GetResource(&This->base, &This->buffer.offset);
- return &This->buffer;
+ This->buffer = NineBuffer9_GetResource(&This->base, &This->offset);
+ return This->buffer;
}
HRESULT NINE_WINAPI