vrend_renderer.c: Fix warnings

vrend_renderer.c: In Funktion »vrend_create_shader_state«:
vrend_renderer.c:2268:62: Warnung: unused parameter »ctx« [-Wunused-
parameter]
 static void *vrend_create_shader_state(struct vrend_context *ctx,
                                                              ^~~
vrend_renderer.c: In Funktion »vrend_draw_bind_vertex_legacy«:
vrend_renderer.c:2702:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    for (i = 0; i < va->count; i++) {
                  ^
vrend_renderer.c: In Funktion »vrend_draw_bind_samplers«:
vrend_renderer.c:2869:57: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
             if (ctx->sub->views[shader_type].old_ids[i] != id || ctx-
>sub->sampler_state_dirty) {

Make fs_stipple_loc a GLint, fixes:
vrend_renderer.c:2887:71: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    if (vrend_state.use_core_profile && ctx->sub->prog->fs_stipple_loc !=
-1) {
                                                                       ^~
vrend_renderer.c: In Funktion »vrend_draw_vbo«:
vrend_renderer.c:3004:62: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
       if (ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id != ctx-
>sub->prog_ids[PIPE_SHADER_VERTEX])
                                                              ^~
vrend_renderer.c:3006:64: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
       if (ctx->sub->shaders[PIPE_SHADER_FRAGMENT]->current->id != ctx-
>sub->prog_ids[PIPE_SHADER_FRAGMENT])
                                                                ^~
vrend_renderer.c:3008:107: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
       if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] && ctx->sub-
>shaders[PIPE_SHADER_GEOMETRY]->current->id != ctx->sub-
>prog_ids[PIPE_SHADER_GEOMETRY])

vrend_renderer.c:3041:55: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    for (shader_type = PIPE_SHADER_VERTEX; shader_type <= ctx->sub-
>last_shader_idx; shader_type++) {
                                                       ^~
vrend_renderer.c:3046:60: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
             if (ctx->sub->prog->const_locs[shader_type][i] != -1)
                                                            ^~
v2: Use mesa-style UNUSED for unused parameters

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 7 years ago committed by Jakob Bornecrantz
parent 951bb52fd5
commit 9b7d7b79d1
  1. 16
      src/vrend_renderer.c

@ -162,7 +162,7 @@ struct vrend_linked_shader_program {
GLuint *ubo_locs[PIPE_SHADER_TYPES]; GLuint *ubo_locs[PIPE_SHADER_TYPES];
GLuint vs_ws_adjust_loc; GLuint vs_ws_adjust_loc;
GLuint fs_stipple_loc; GLint fs_stipple_loc;
GLuint clip_locs[8]; GLuint clip_locs[8];
}; };
@ -2265,7 +2265,7 @@ static int vrend_shader_select(struct vrend_context *ctx,
return 0; return 0;
} }
static void *vrend_create_shader_state(struct vrend_context *ctx, static void *vrend_create_shader_state(UNUSED struct vrend_context *ctx,
const struct pipe_stream_output_info *so_info, const struct pipe_stream_output_info *so_info,
unsigned pipe_shader_type) unsigned pipe_shader_type)
{ {
@ -2699,7 +2699,7 @@ static void vrend_draw_bind_vertex_legacy(struct vrend_context *ctx,
num_enable = va->count; num_enable = va->count;
enable_bitmask = 0; enable_bitmask = 0;
disable_bitmask = ~((1ull << num_enable) - 1); disable_bitmask = ~((1ull << num_enable) - 1);
for (i = 0; i < va->count; i++) { for (i = 0; i < (int)va->count; i++) {
struct vrend_vertex_element *ve = &va->elements[i]; struct vrend_vertex_element *ve = &va->elements[i];
int vbo_index = ve->base.vertex_buffer_index; int vbo_index = ve->base.vertex_buffer_index;
struct vrend_resource *res; struct vrend_resource *res;
@ -2856,7 +2856,7 @@ static void vrend_draw_bind_samplers(struct vrend_context *ctx)
glActiveTexture(GL_TEXTURE0 + sampler_id); glActiveTexture(GL_TEXTURE0 + sampler_id);
if (texture) { if (texture) {
int id; GLuint id;
GLenum target = texture->target; GLenum target = texture->target;
if (texture->is_buffer) { if (texture->is_buffer) {
@ -2947,7 +2947,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
{ {
int i; int i;
bool new_program = false; bool new_program = false;
uint32_t shader_type; int32_t shader_type;
struct vrend_resource *indirect_res = NULL; struct vrend_resource *indirect_res = NULL;
if (ctx->in_error) if (ctx->in_error)
@ -3001,11 +3001,11 @@ void vrend_draw_vbo(struct vrend_context *ctx,
return; return;
} }
same_prog = true; same_prog = true;
if (ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id != ctx->sub->prog_ids[PIPE_SHADER_VERTEX]) if (ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_VERTEX])
same_prog = false; same_prog = false;
if (ctx->sub->shaders[PIPE_SHADER_FRAGMENT]->current->id != ctx->sub->prog_ids[PIPE_SHADER_FRAGMENT]) if (ctx->sub->shaders[PIPE_SHADER_FRAGMENT]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_FRAGMENT])
same_prog = false; same_prog = false;
if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] && ctx->sub->shaders[PIPE_SHADER_GEOMETRY]->current->id != ctx->sub->prog_ids[PIPE_SHADER_GEOMETRY]) if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] && ctx->sub->shaders[PIPE_SHADER_GEOMETRY]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_GEOMETRY])
same_prog = false; same_prog = false;
if (!same_prog) { if (!same_prog) {

Loading…
Cancel
Save