Skip to content

aco/isel: Always export position from VS

Tony Wasserka requested to merge neobrain/mesa:position-export into master

Closes #3615 (closed). This game submits a fully empty vertex shader, which ACO turns into exp pos0 off, off, off, off done vm whereas I observed LLVM to output the constant vector (0,0,0,1). Indeed, the ISA docs say:

Every vertex shader must output at least one position vector (x, y, z; w is optional) to the POS0 target

With this patch, the new ACO behavior doesn't fully match LLVM but at least it outputs something for the position data now.

Open questions:

  • Is the empty vertex shader submitted by Star Citizen valid? GLSL 4.60 allows this behavior
  • Should ACO match LLVM in exporting the constant (0,0,0,1)? GLSL 4.60 imposes no requirements, but exporting anything other than zero-area primitives could cause weird effects. This MR exports zero-area primitives.
  • ISA docs only talk about VS, but does this need to be applied for other hardware stages too? I'm guessing this needs to be done at least for NGG, too. Enabled for both VS and NGG now
Edited by Tony Wasserka

Merge request reports