Commit 2c300765 authored by Rhys Kidd's avatar Rhys Kidd Committed by Emil Velikov

i965: Resolve GCC sign-compare warning.

mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_control_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:805:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) {
                      ^
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_source_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:839:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
                      ^
mesa/src/mesa/drivers/dri/i965/brw_state_dump.c: In function 'dump_sampler_state':
mesa/src/mesa/drivers/dri/i965/brw_state_dump.c:382:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size / 16; i++) {
                  ^
mesa/src/mesa/drivers/dri/i965/brw_state_upload.c: In function 'brw_pipeline_state_finished':
mesa/src/mesa/drivers/dri/i965/brw_state_upload.c:801:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (i != pipeline) {
             ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_gen7_hiz_buf_create':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1544:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                               ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_gen8_hiz_buf_create':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1638:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                            ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_miptree_alloc_hiz':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1771:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                            ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1775:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int layer = 0; layer < mt->level[level].depth; ++layer) {
                                 ^
Signed-off-by: default avatarRhys Kidd <rhyskidd@gmail.com>
Reviewed-by: default avatarThomas Helland <thomashelland90@gmail.com>
Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
parent 1c194840
...@@ -802,7 +802,7 @@ set_3src_control_index(const struct brw_device_info *devinfo, ...@@ -802,7 +802,7 @@ set_3src_control_index(const struct brw_device_info *devinfo,
if (devinfo->gen >= 9 || devinfo->is_cherryview) if (devinfo->gen >= 9 || devinfo->is_cherryview)
uncompacted |= brw_inst_bits(src, 36, 35) << 24; /* 2b */ uncompacted |= brw_inst_bits(src, 36, 35) << 24; /* 2b */
for (int i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) { for (unsigned i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) {
if (gen8_3src_control_index_table[i] == uncompacted) { if (gen8_3src_control_index_table[i] == uncompacted) {
brw_compact_inst_set_3src_control_index(dst, i); brw_compact_inst_set_3src_control_index(dst, i);
return true; return true;
...@@ -836,7 +836,7 @@ set_3src_source_index(const struct brw_device_info *devinfo, ...@@ -836,7 +836,7 @@ set_3src_source_index(const struct brw_device_info *devinfo,
(brw_inst_bits(src, 104, 104) << 44); /* 1b */ (brw_inst_bits(src, 104, 104) << 44); /* 1b */
} }
for (int i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) { for (unsigned i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
if (gen8_3src_source_index_table[i] == uncompacted) { if (gen8_3src_source_index_table[i] == uncompacted) {
brw_compact_inst_set_3src_source_index(dst, i); brw_compact_inst_set_3src_source_index(dst, i);
return true; return true;
......
...@@ -376,13 +376,13 @@ dump_sdc(struct brw_context *brw, uint32_t offset) ...@@ -376,13 +376,13 @@ dump_sdc(struct brw_context *brw, uint32_t offset)
static void dump_sampler_state(struct brw_context *brw, static void dump_sampler_state(struct brw_context *brw,
uint32_t offset, uint32_t size) uint32_t offset, uint32_t size)
{ {
int i; unsigned i;
uint32_t *samp = brw->batch.bo->virtual + offset; uint32_t *samp = brw->batch.bo->virtual + offset;
for (i = 0; i < size / 16; i++) { for (i = 0; i < size / 16; i++) {
char name[20]; char name[20];
sprintf(name, "WM SAMP%d", i); sprintf(name, "WM SAMP%u", i);
batch_out(brw, name, offset, 0, "filtering\n"); batch_out(brw, name, offset, 0, "filtering\n");
batch_out(brw, name, offset, 1, "wrapping, lod\n"); batch_out(brw, name, offset, 1, "wrapping, lod\n");
batch_out(brw, name, offset, 2, "default color pointer\n"); batch_out(brw, name, offset, 2, "default color pointer\n");
......
...@@ -797,7 +797,7 @@ brw_pipeline_state_finished(struct brw_context *brw, ...@@ -797,7 +797,7 @@ brw_pipeline_state_finished(struct brw_context *brw,
enum brw_pipeline pipeline) enum brw_pipeline pipeline)
{ {
/* Save all dirty state into the other pipelines */ /* Save all dirty state into the other pipelines */
for (int i = 0; i < BRW_NUM_PIPELINES; i++) { for (unsigned i = 0; i < BRW_NUM_PIPELINES; i++) {
if (i != pipeline) { if (i != pipeline) {
brw->state.pipelines[i].mesa |= brw->NewGLState; brw->state.pipelines[i].mesa |= brw->NewGLState;
brw->state.pipelines[i].brw |= brw->ctx.NewDriverState; brw->state.pipelines[i].brw |= brw->ctx.NewDriverState;
......
...@@ -1539,7 +1539,7 @@ intel_gen7_hiz_buf_create(struct brw_context *brw, ...@@ -1539,7 +1539,7 @@ intel_gen7_hiz_buf_create(struct brw_context *brw,
unsigned H_i = H0; unsigned H_i = H0;
unsigned Z_i = Z0; unsigned Z_i = Z0;
hz_height = 0; hz_height = 0;
for (int level = mt->first_level; level <= mt->last_level; ++level) { for (unsigned level = mt->first_level; level <= mt->last_level; ++level) {
unsigned h_i = ALIGN(H_i, vertical_align); unsigned h_i = ALIGN(H_i, vertical_align);
/* sum(i=0 to m; h_i * max(1, floor(Z_Depth/2**i))) */ /* sum(i=0 to m; h_i * max(1, floor(Z_Depth/2**i))) */
hz_height += h_i * Z_i; hz_height += h_i * Z_i;
...@@ -1635,7 +1635,7 @@ intel_gen8_hiz_buf_create(struct brw_context *brw, ...@@ -1635,7 +1635,7 @@ intel_gen8_hiz_buf_create(struct brw_context *brw,
unsigned Z_i = Z0; unsigned Z_i = Z0;
unsigned sum_h_i = 0; unsigned sum_h_i = 0;
unsigned hz_height_3d_sum = 0; unsigned hz_height_3d_sum = 0;
for (int level = mt->first_level; level <= mt->last_level; ++level) { for (unsigned level = mt->first_level; level <= mt->last_level; ++level) {
unsigned i = level - mt->first_level; unsigned i = level - mt->first_level;
unsigned h_i = ALIGN(H_i, vertical_align); unsigned h_i = ALIGN(H_i, vertical_align);
/* sum(i=2 to m; h_i) */ /* sum(i=2 to m; h_i) */
...@@ -1768,11 +1768,11 @@ intel_miptree_alloc_hiz(struct brw_context *brw, ...@@ -1768,11 +1768,11 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
return false; return false;
/* Mark that all slices need a HiZ resolve. */ /* Mark that all slices need a HiZ resolve. */
for (int level = mt->first_level; level <= mt->last_level; ++level) { for (unsigned level = mt->first_level; level <= mt->last_level; ++level) {
if (!intel_miptree_level_enable_hiz(brw, mt, level)) if (!intel_miptree_level_enable_hiz(brw, mt, level))
continue; continue;
for (int layer = 0; layer < mt->level[level].depth; ++layer) { for (unsigned layer = 0; layer < mt->level[level].depth; ++layer) {
struct intel_resolve_map *m = malloc(sizeof(struct intel_resolve_map)); struct intel_resolve_map *m = malloc(sizeof(struct intel_resolve_map));
exec_node_init(&m->link); exec_node_init(&m->link);
m->level = level; m->level = level;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment