Better follow HLSL offsets rules (#3575)
Matrices consuming one vector are treated like vectors for alignment, and there is no "trailing padding" for matrices and arrays.
This commit is contained in:
parent
9001ec9aa5
commit
593dbafd0d
6 changed files with 229 additions and 8 deletions
|
|
@ -2217,9 +2217,9 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, T
|
|||
}
|
||||
|
||||
// To aid the basic HLSL rule about crossing vec4 boundaries.
|
||||
bool TIntermediate::improperStraddle(const TType& type, int size, int offset)
|
||||
bool TIntermediate::improperStraddle(const TType& type, int size, int offset, bool vectorLike)
|
||||
{
|
||||
if (! type.isVector() || type.isArray())
|
||||
if (! vectorLike || type.isArray())
|
||||
return false;
|
||||
|
||||
return size <= 16 ? offset / 16 != (offset + size - 1) / 16
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue