c++ - Is there a performance penalty for creating Direct3D vertices with all semantic types? -
in direct3d, can create type of vertex like. can have simple vertex positional information, or add colour info, texture info, etc etc. when creating input layout, define parts of vertex you've implemented:
d3d10_input_element_desc layout[] = { { "position", 0, dxgi_format_r32g32b32_float, 0, 0, d3d10_input_per_vertex_data, 0 }, { "color", 0, dxgi_format_r32g32b32a32_float, 0, d3d10_append_aligned_element, d3d10_input_per_vertex_data, 0 }, };
my question is, should define vertex structure all of input types (position, colour, texture etc etc). or should create several vertex structures, each different types of input.
the downsides using multiple classes have create , maintain several classes, , confusing knowing type of vertex use. downsides of having 1 vertex structure?
you upload unused vertex data 3d accelerator, , eat bandwidth. shouldn't matter unless doing top notch video game (you'll have bottleneck somewhere else).
Comments
Post a Comment