mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
zink/spirv: support vec1 coordinates
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
499bf41487
commit
69189417ae
1 changed files with 11 additions and 6 deletions
|
|
@ -1165,12 +1165,17 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
|
|||
|
||||
if (proj) {
|
||||
SpvId constituents[coord_components + 1];
|
||||
SpvId float_type = spirv_builder_type_float(&ctx->builder, 32);
|
||||
for (uint32_t i = 0; i < coord_components; ++i)
|
||||
constituents[i] = spirv_builder_emit_composite_extract(&ctx->builder,
|
||||
float_type,
|
||||
coord,
|
||||
&i, 1);
|
||||
if (coord_components == 1)
|
||||
constituents[0] = coord;
|
||||
else {
|
||||
assert(coord_components > 1);
|
||||
SpvId float_type = spirv_builder_type_float(&ctx->builder, 32);
|
||||
for (uint32_t i = 0; i < coord_components; ++i)
|
||||
constituents[i] = spirv_builder_emit_composite_extract(&ctx->builder,
|
||||
float_type,
|
||||
coord,
|
||||
&i, 1);
|
||||
}
|
||||
|
||||
constituents[coord_components++] = proj;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue