fix(metal): a vertex function's base_vertex reads Vulkan's first vertex, the vertex offset of an indexed draw, where it read OpenGL's base vertex, which ACO does not implement and aborts on
This commit is contained in:
1 parent
3c0dd58acb
commit
d7b7fd6347
2 files changed
+5
-2
No files matched your search
@@ -1254,7 +1254,10 @@ builtin_value(struct translator *t, enum stela_air_builtin builtin)
|
||||
return nir_channel(b, t->patch_ids, 1);
|
||||
return nir_iadd(b, nir_load_instance_id(b), nir_load_base_instance(b));
|
||||
case STELA_AIR_BASE_VERTEX:
|
||||
return nir_load_base_vertex(b);
|
||||
/* Vulkan's BaseVertex: the vertex offset of an indexed draw, the
|
||||
* first vertex of another. NIR's base_vertex is OpenGL's, which
|
||||
* Vulkan drivers need not implement (ACO does not). */
|
||||
return nir_load_first_vertex(b);
|
||||
case STELA_AIR_BASE_INSTANCE:
|
||||
return t->patch_ids ? nir_channel(b, t->patch_ids, 2) : nir_load_base_instance(b);
|
||||
case STELA_AIR_PATCH_ID:
|
||||
|
||||
@@ -259,7 +259,7 @@ vertex_builtins_include_the_bases(void)
|
||||
struct census census = count(shader);
|
||||
assert(census.intrinsics[nir_intrinsic_load_vertex_id] == 1);
|
||||
assert(census.intrinsics[nir_intrinsic_load_instance_id] == 1);
|
||||
assert(census.intrinsics[nir_intrinsic_load_base_vertex] == 1);
|
||||
assert(census.intrinsics[nir_intrinsic_load_first_vertex] == 1);
|
||||
/* instance_id adds it, and base_instance reads it. */
|
||||
assert(census.intrinsics[nir_intrinsic_load_base_instance] == 2);
|
||||
assert(census.amplification_loads == 1 && census.count_loads == 1);
|
||||
|
||||
Reference in new issue
Block a user