mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 08:40:39 +01:00
d3d1x: setup draw info primitive restart parameters
This commit is contained in:
parent
4465efc3bf
commit
0cf1a55568
1 changed files with 22 additions and 3 deletions
|
|
@ -71,6 +71,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
D3D11_PRIMITIVE_TOPOLOGY primitive_topology;
|
||||
DXGI_FORMAT index_format;
|
||||
unsigned index_offset;
|
||||
uint32_t strip_cut_index;
|
||||
BOOL render_predicate_value;
|
||||
float blend_color[4];
|
||||
unsigned sample_mask;
|
||||
|
|
@ -174,6 +175,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
primitive_topology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
||||
index_format = DXGI_FORMAT_UNKNOWN;
|
||||
index_offset = 0;
|
||||
strip_cut_index = 0xffffffff;
|
||||
render_predicate_value = 0;
|
||||
memset(blend_color, 0, sizeof(blend_color));
|
||||
sample_mask = ~0;
|
||||
|
|
@ -673,12 +675,20 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
}
|
||||
else
|
||||
{
|
||||
if(index_format == DXGI_FORMAT_R32_UINT)
|
||||
switch(index_format) {
|
||||
case DXGI_FORMAT_R32_UINT:
|
||||
ib.index_size = 4;
|
||||
else if(index_format == DXGI_FORMAT_R16_UINT)
|
||||
strip_cut_index = 0xffffffff;
|
||||
break;
|
||||
case DXGI_FORMAT_R16_UINT:
|
||||
ib.index_size = 2;
|
||||
else
|
||||
strip_cut_index = 0xffff;
|
||||
break;
|
||||
default:
|
||||
ib.index_size = 1;
|
||||
strip_cut_index = 0xff;
|
||||
break;
|
||||
}
|
||||
ib.offset = index_offset;
|
||||
ib.buffer = index_buffer ? ((GalliumD3D11Buffer*)index_buffer.p)->resource : 0;
|
||||
}
|
||||
|
|
@ -755,6 +765,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = 0;
|
||||
info.instance_count = 1;
|
||||
info.primitive_restart = FALSE;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
@ -777,6 +788,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = 0;
|
||||
info.instance_count = 1;
|
||||
info.primitive_restart = TRUE;
|
||||
info.restart_index = strip_cut_index;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
@ -802,6 +815,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = start_instance_location;
|
||||
info.instance_count = instance_count;
|
||||
info.primitive_restart = FALSE;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
@ -826,6 +840,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = start_instance_location;
|
||||
info.instance_count = instance_count;
|
||||
info.primitive_restart = TRUE;
|
||||
info.restart_index = strip_cut_index;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
@ -869,6 +885,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = 0;
|
||||
info.instance_count = data.instance_count;
|
||||
info.primitive_restart = FALSE;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
@ -899,6 +916,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
|
|||
info.max_index = ~0;
|
||||
info.start_instance = 0;
|
||||
info.instance_count = data.instance_count;
|
||||
info.primitive_restart = TRUE;
|
||||
info.restart_index = strip_cut_index;
|
||||
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue