Go back to reporting normalised vertex inputs on GL as SNorm/UNorm

* This is still accurate, what we're missing is "read data as int, then cast to
  float" which is represented by setting 'floatCast' to true. A normalized cast
  or interpret is accurately represented by saying the input is snorm/unorm
  typed.
This commit is contained in:
baldurk
2020-08-13 10:22:56 +01:00
parent 9df6103be4
commit aac929af8f
4 changed files with 14 additions and 34 deletions
+3 -11
View File
@@ -43,8 +43,8 @@ struct VertexAttribute
bool operator==(const VertexAttribute &o) const
{
return enabled == o.enabled && floatCast == o.floatCast && normalizedCast == o.normalizedCast &&
format == o.format && !memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) &&
return enabled == o.enabled && floatCast == o.floatCast && format == o.format &&
!memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) &&
vertexBufferSlot == o.vertexBufferSlot && byteOffset == o.byteOffset;
}
bool operator<(const VertexAttribute &o) const
@@ -53,8 +53,6 @@ struct VertexAttribute
return enabled < o.enabled;
if(!(floatCast == o.floatCast))
return floatCast < o.floatCast;
if(!(normalizedCast == o.normalizedCast))
return normalizedCast < o.normalizedCast;
if(!(format == o.format))
return format < o.format;
if(memcmp(&genericValue, &o.genericValue, sizeof(genericValue)) < 0)
@@ -71,16 +69,10 @@ struct VertexAttribute
DOCUMENT(R"(Only valid for integer formatted attributes, ``True`` if they are cast to float.
This is because they were specified with an integer format but glVertexAttribFormat (not
glVertexAttribIFormat) so they will be cast. See also :data:`normalisedCast` to see if the integer
data is normalised to [0,1] or [-1,1] while being cast.
glVertexAttribIFormat) so they will be cast.
)");
bool floatCast = false;
DOCUMENT(R"(Only valid for integer formatted attributes, ``True`` if the data is normalised while
cast to float. See :data:`floatCast` for more information.
)");
bool normalizedCast = false;
DOCUMENT("The :class:`ResourceFormat` of the vertex attribute.");
ResourceFormat format;