radeonsi: Fix array indices for detecting integer vertex formats
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 12 Feb 2013 16:49:36 +0000 (17:49 +0100)
committerMichel Dänzer <michel@daenzer.net>
Thu, 14 Feb 2013 09:31:21 +0000 (10:31 +0100)
src/gallium/drivers/radeonsi/si_state.c

index 74284690f0491f94c4423cf85879278214444021..5cca08579ed867800fc9c839ca493c2b89de20e0 100644 (file)
@@ -2520,7 +2520,7 @@ static void *si_create_vertex_elements(struct pipe_context *ctx,
                case UTIL_FORMAT_TYPE_SIGNED:
                        if (desc->channel[first_non_void].normalized)
                                num_format = V_008F0C_BUF_NUM_FORMAT_SNORM;
-                       else if (desc->channel[i].pure_integer)
+                       else if (desc->channel[first_non_void].pure_integer)
                                num_format = V_008F0C_BUF_NUM_FORMAT_SINT;
                        else
                                num_format = V_008F0C_BUF_NUM_FORMAT_SSCALED;
@@ -2528,7 +2528,7 @@ static void *si_create_vertex_elements(struct pipe_context *ctx,
                case UTIL_FORMAT_TYPE_UNSIGNED:
                        if (desc->channel[first_non_void].normalized)
                                num_format = V_008F0C_BUF_NUM_FORMAT_UNORM;
-                       else if (desc->channel[i].pure_integer)
+                       else if (desc->channel[first_non_void].pure_integer)
                                num_format = V_008F0C_BUF_NUM_FORMAT_UINT;
                        else
                                num_format = V_008F0C_BUF_NUM_FORMAT_USCALED;