etnaviv: handle integer case for GENERIC_ATTRIB_SCALE
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sat, 19 Oct 2019 17:12:53 +0000 (19:12 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 29 Nov 2019 14:06:18 +0000 (15:06 +0100)
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_state.c

index f5f5993abc59e175497ab1e10a2e60ee2f7a5745..0fde8e76fa8a29dbb7f906b5238c2457655802ed 100644 (file)
@@ -597,7 +597,11 @@ etna_vertex_elements_state_create(struct pipe_context *pctx,
             COND(nonconsecutive, VIVS_NFE_GENERIC_ATTRIB_CONFIG1_NONCONSECUTIVE) |
             VIVS_NFE_GENERIC_ATTRIB_CONFIG1_END(end_offset - start_offset);
       }
-      cs->NFE_GENERIC_ATTRIB_SCALE[idx] = 0x3f800000; /* 1 for integer, 1.0 for float */
+
+      if (util_format_is_pure_integer(elements[idx].src_format))
+         cs->NFE_GENERIC_ATTRIB_SCALE[idx] = 1;
+      else
+         cs->NFE_GENERIC_ATTRIB_SCALE[idx] = fui(1.0f);
    }
 
    return cs;