set_mode_system_value(b, mode);
break;
case SpvBuiltInBaseVertex:
- *location = SYSTEM_VALUE_BASE_VERTEX;
+ /* OpenGL gl_BaseVertex (SYSTEM_VALUE_BASE_VERTEX) is not the same
+ * semantic as SPIR-V BaseVertex (SYSTEM_VALUE_FIRST_VERTEX).
+ */
+ *location = SYSTEM_VALUE_FIRST_VERTEX;
set_mode_system_value(b, mode);
break;
case SpvBuiltInBaseInstance:
genX(cmd_buffer_flush_state)(cmd_buffer);
- if (vs_prog_data->uses_basevertex || vs_prog_data->uses_baseinstance)
+ if (vs_prog_data->uses_firstvertex ||
+ vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_baseinstance)
emit_base_vertex_instance(cmd_buffer, firstVertex, firstInstance);
if (vs_prog_data->uses_drawid)
emit_draw_index(cmd_buffer, 0);
genX(cmd_buffer_flush_state)(cmd_buffer);
- if (vs_prog_data->uses_basevertex || vs_prog_data->uses_baseinstance)
+ if (vs_prog_data->uses_firstvertex ||
+ vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_baseinstance)
emit_base_vertex_instance(cmd_buffer, vertexOffset, firstInstance);
if (vs_prog_data->uses_drawid)
emit_draw_index(cmd_buffer, 0);
struct anv_bo *bo = buffer->bo;
uint32_t bo_offset = buffer->offset + offset;
- if (vs_prog_data->uses_basevertex || vs_prog_data->uses_baseinstance)
+ if (vs_prog_data->uses_firstvertex ||
+ vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_baseinstance)
emit_base_vertex_instance_bo(cmd_buffer, bo, bo_offset + 8);
if (vs_prog_data->uses_drawid)
emit_draw_index(cmd_buffer, i);
uint32_t bo_offset = buffer->offset + offset;
/* TODO: We need to stomp base vertex to 0 somehow */
- if (vs_prog_data->uses_basevertex || vs_prog_data->uses_baseinstance)
+ if (vs_prog_data->uses_firstvertex ||
+ vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_baseinstance)
emit_base_vertex_instance_bo(cmd_buffer, bo, bo_offset + 12);
if (vs_prog_data->uses_drawid)
emit_draw_index(cmd_buffer, i);
const bool needs_svgs_elem = vs_prog_data->uses_vertexid ||
vs_prog_data->uses_instanceid ||
vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_firstvertex ||
vs_prog_data->uses_baseinstance;
uint32_t elem_count = __builtin_popcount(elements) -
* well. Just do all or nothing.
*/
uint32_t base_ctrl = (vs_prog_data->uses_basevertex ||
+ vs_prog_data->uses_firstvertex ||
vs_prog_data->uses_baseinstance) ?
VFCOMP_STORE_SRC : VFCOMP_STORE_0;