wined3d: Remove draw_*_primitive_up.
Note that I can't remove the state->user_stream mess yet, because of draw_*_primitive_strided. Another patchset will deal with that.
This commit is contained in:
parent
f3f172ce81
commit
8cf55497cc
|
@ -4160,106 +4160,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
|||
draw_primitive(device, start_idx, index_count, start_instance, instance_count, TRUE, NULL);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_primitive_up(struct wined3d_device *device, UINT vertex_count,
|
||||
const void *stream_data, UINT stream_stride)
|
||||
{
|
||||
struct wined3d_stream_state *stream;
|
||||
struct wined3d_buffer *vb;
|
||||
|
||||
TRACE("device %p, vertex count %u, stream_data %p, stream_stride %u.\n",
|
||||
device, vertex_count, stream_data, stream_stride);
|
||||
|
||||
if (!device->stateBlock->state.vertex_declaration)
|
||||
{
|
||||
WARN("Called without a valid vertex declaration set.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Note in the following, it's not this type, but that's the purpose of streamIsUP */
|
||||
stream = &device->stateBlock->state.streams[0];
|
||||
vb = stream->buffer;
|
||||
stream->buffer = (struct wined3d_buffer *)stream_data;
|
||||
if (vb)
|
||||
wined3d_buffer_decref(vb);
|
||||
stream->offset = 0;
|
||||
stream->stride = stream_stride;
|
||||
device->stateBlock->state.user_stream = TRUE;
|
||||
if (device->stateBlock->state.load_base_vertex_index)
|
||||
{
|
||||
device->stateBlock->state.load_base_vertex_index = 0;
|
||||
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
|
||||
}
|
||||
|
||||
/* TODO: Only mark dirty if drawing from a different UP address */
|
||||
device_invalidate_state(device, STATE_STREAMSRC);
|
||||
|
||||
draw_primitive(device, 0, vertex_count, 0, 0, FALSE, NULL);
|
||||
|
||||
/* MSDN specifies stream zero settings must be set to NULL */
|
||||
stream->buffer = NULL;
|
||||
stream->stride = 0;
|
||||
|
||||
/* stream zero settings set to null at end, as per the msdn. No need to
|
||||
* mark dirty here, the app has to set the new stream sources or use UP
|
||||
* drawing again. */
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *device,
|
||||
UINT index_count, const void *index_data, enum wined3d_format_id index_data_format_id,
|
||||
const void *stream_data, UINT stream_stride)
|
||||
{
|
||||
struct wined3d_stream_state *stream;
|
||||
struct wined3d_buffer *vb, *ib;
|
||||
|
||||
TRACE("device %p, index_count %u, index_data %p, index_data_format %s, stream_data %p, stream_stride %u.\n",
|
||||
device, index_count, index_data, debug_d3dformat(index_data_format_id), stream_data, stream_stride);
|
||||
|
||||
if (!device->stateBlock->state.vertex_declaration)
|
||||
{
|
||||
WARN("(%p) : Called without a valid vertex declaration set\n", device);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
stream = &device->stateBlock->state.streams[0];
|
||||
vb = stream->buffer;
|
||||
stream->buffer = (struct wined3d_buffer *)stream_data;
|
||||
if (vb)
|
||||
wined3d_buffer_decref(vb);
|
||||
stream->offset = 0;
|
||||
stream->stride = stream_stride;
|
||||
device->stateBlock->state.user_stream = TRUE;
|
||||
device->stateBlock->state.index_format = index_data_format_id;
|
||||
|
||||
/* Set to 0 as per MSDN. Do it now due to the stream source loading during draw_primitive(). */
|
||||
device->stateBlock->state.base_vertex_index = 0;
|
||||
if (device->stateBlock->state.load_base_vertex_index)
|
||||
{
|
||||
device->stateBlock->state.load_base_vertex_index = 0;
|
||||
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
|
||||
}
|
||||
/* Invalidate the state until we have nicer tracking of the stream source pointers */
|
||||
device_invalidate_state(device, STATE_STREAMSRC);
|
||||
device_invalidate_state(device, STATE_INDEXBUFFER);
|
||||
|
||||
draw_primitive(device, 0, index_count, 0, 0, TRUE, index_data);
|
||||
|
||||
/* MSDN specifies stream zero settings and index buffer must be set to NULL */
|
||||
stream->buffer = NULL;
|
||||
stream->stride = 0;
|
||||
ib = device->stateBlock->state.index_buffer;
|
||||
if (ib)
|
||||
{
|
||||
wined3d_buffer_decref(ib);
|
||||
device->stateBlock->state.index_buffer = NULL;
|
||||
}
|
||||
/* No need to mark the stream source state dirty here. Either the app calls UP drawing again, or it has to call
|
||||
* SetStreamSource to specify a vertex buffer
|
||||
*/
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_primitive_strided(struct wined3d_device *device,
|
||||
UINT vertex_count, const struct wined3d_strided_data *strided_data)
|
||||
{
|
||||
|
|
|
@ -45,10 +45,8 @@
|
|||
@ cdecl wined3d_device_draw_indexed_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_instanced(ptr long long long long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_strided(ptr long ptr long ptr long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_up(ptr long ptr long ptr long)
|
||||
@ cdecl wined3d_device_draw_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_primitive_strided(ptr long ptr)
|
||||
@ cdecl wined3d_device_draw_primitive_up(ptr long ptr long)
|
||||
@ cdecl wined3d_device_draw_rect_patch(ptr long ptr ptr)
|
||||
@ cdecl wined3d_device_draw_tri_patch(ptr long ptr ptr)
|
||||
@ cdecl wined3d_device_end_scene(ptr)
|
||||
|
|
|
@ -2094,14 +2094,9 @@ void __cdecl wined3d_device_draw_indexed_primitive_instanced(struct wined3d_devi
|
|||
HRESULT __cdecl wined3d_device_draw_indexed_primitive_strided(struct wined3d_device *device, UINT index_count,
|
||||
const struct wined3d_strided_data *strided_data, UINT vertex_count, const void *index_data,
|
||||
enum wined3d_format_id index_data_format_id);
|
||||
HRESULT __cdecl wined3d_device_draw_indexed_primitive_up(struct wined3d_device *device,
|
||||
UINT index_count, const void *index_data, enum wined3d_format_id index_data_format_id,
|
||||
const void *stream_data, UINT stream_stride);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive_strided(struct wined3d_device *device,
|
||||
UINT vertex_count, const struct wined3d_strided_data *strided_data);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive_up(struct wined3d_device *device,
|
||||
UINT vertex_count, const void *stream_data, UINT stream_stride);
|
||||
HRESULT __cdecl wined3d_device_draw_rect_patch(struct wined3d_device *device, UINT handle,
|
||||
const float *num_segs, const struct wined3d_rect_patch_info *rect_patch_info);
|
||||
HRESULT __cdecl wined3d_device_draw_tri_patch(struct wined3d_device *device, UINT handle,
|
||||
|
|
Loading…
Reference in New Issue