mesa: fix double->float assignment warnings, int/uint comparison warnings
Reported by Karl Schultz.
This commit is contained in:
@@ -515,7 +515,7 @@ _mesa_emit_nv_temp_initialization(GLcontext *ctx,
|
|||||||
struct gl_program *program)
|
struct gl_program *program)
|
||||||
{
|
{
|
||||||
struct prog_instruction *inst;
|
struct prog_instruction *inst;
|
||||||
int i;
|
GLuint i;
|
||||||
|
|
||||||
if (!ctx->Shader.EmitNVTempInitialization)
|
if (!ctx->Shader.EmitNVTempInitialization)
|
||||||
return;
|
return;
|
||||||
@@ -559,7 +559,7 @@ _mesa_emit_nv_temp_initialization(GLcontext *ctx,
|
|||||||
void
|
void
|
||||||
_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program)
|
_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program)
|
||||||
{
|
{
|
||||||
int i;
|
GLuint i;
|
||||||
|
|
||||||
program->NumTemporaries = 0;
|
program->NumTemporaries = 0;
|
||||||
for (i = 0; i < program->NumInstructions; i++) {
|
for (i = 0; i < program->NumInstructions; i++) {
|
||||||
|
@@ -1017,12 +1017,12 @@ _mesa_execute_program(GLcontext * ctx,
|
|||||||
/* XXX we could probably just use pow() here */
|
/* XXX we could probably just use pow() here */
|
||||||
if (a[0] > 0.0F) {
|
if (a[0] > 0.0F) {
|
||||||
if (a[1] == 0.0 && a[3] == 0.0)
|
if (a[1] == 0.0 && a[3] == 0.0)
|
||||||
result[2] = 1.0;
|
result[2] = 1.0F;
|
||||||
else
|
else
|
||||||
result[2] = (GLfloat) _mesa_pow(a[1], a[3]);
|
result[2] = (GLfloat) _mesa_pow(a[1], a[3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result[2] = 0.0;
|
result[2] = 0.0F;
|
||||||
}
|
}
|
||||||
result[3] = 1.0F;
|
result[3] = 1.0F;
|
||||||
store_vector4(inst, machine, result);
|
store_vector4(inst, machine, result);
|
||||||
|
@@ -459,7 +459,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog)
|
|||||||
*/
|
*/
|
||||||
for (j = i + 1; j < prog->NumInstructions; j++) {
|
for (j = i + 1; j < prog->NumInstructions; j++) {
|
||||||
struct prog_instruction *inst2 = prog->Instructions + j;
|
struct prog_instruction *inst2 = prog->Instructions + j;
|
||||||
int arg;
|
GLuint arg;
|
||||||
|
|
||||||
if (_mesa_is_flow_control_opcode(inst2->Opcode))
|
if (_mesa_is_flow_control_opcode(inst2->Opcode))
|
||||||
break;
|
break;
|
||||||
@@ -867,7 +867,7 @@ find_live_intervals(struct gl_program *prog,
|
|||||||
_mesa_printf("Reg[%d] live [%d, %d]:",
|
_mesa_printf("Reg[%d] live [%d, %d]:",
|
||||||
inv->Reg, inv->Start, inv->End);
|
inv->Reg, inv->Start, inv->End);
|
||||||
if (1) {
|
if (1) {
|
||||||
int j;
|
GLuint j;
|
||||||
for (j = 0; j < inv->Start; j++)
|
for (j = 0; j < inv->Start; j++)
|
||||||
_mesa_printf(" ");
|
_mesa_printf(" ");
|
||||||
for (j = inv->Start; j <= inv->End; j++)
|
for (j = inv->Start; j <= inv->End; j++)
|
||||||
@@ -945,7 +945,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
GLint j;
|
GLint j;
|
||||||
for (j = 0; j < activeIntervals.Num; j++) {
|
for (j = 0; j < (GLint) activeIntervals.Num; j++) {
|
||||||
const struct interval *inv = activeIntervals.Intervals + j;
|
const struct interval *inv = activeIntervals.Intervals + j;
|
||||||
if (inv->End >= live->Start) {
|
if (inv->End >= live->Start) {
|
||||||
/* Stop now. Since the activeInterval list is sorted
|
/* Stop now. Since the activeInterval list is sorted
|
||||||
@@ -994,7 +994,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxTemp + 1 < liveIntervals.Num) {
|
if (maxTemp + 1 < (GLint) liveIntervals.Num) {
|
||||||
/* OK, we've reduced the number of registers needed.
|
/* OK, we've reduced the number of registers needed.
|
||||||
* Scan the program and replace all the old temporary register
|
* Scan the program and replace all the old temporary register
|
||||||
* indexes with the new indexes.
|
* indexes with the new indexes.
|
||||||
|
@@ -580,7 +580,7 @@ _mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count)
|
|||||||
for (i = 0; i < prog->NumInstructions; i++) {
|
for (i = 0; i < prog->NumInstructions; i++) {
|
||||||
struct prog_instruction *inst = prog->Instructions + i;
|
struct prog_instruction *inst = prog->Instructions + i;
|
||||||
if (inst->BranchTarget > 0) {
|
if (inst->BranchTarget > 0) {
|
||||||
if (inst->BranchTarget > start) {
|
if (inst->BranchTarget > (GLint) start) {
|
||||||
inst->BranchTarget -= count;
|
inst->BranchTarget -= count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -955,7 +955,7 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
|
|||||||
|
|
||||||
if (size) {
|
if (size) {
|
||||||
GLint typeSize = sizeof_glsl_type(param->DataType);
|
GLint typeSize = sizeof_glsl_type(param->DataType);
|
||||||
if (param->Size > typeSize) {
|
if ((GLint) param->Size > typeSize) {
|
||||||
/* This is an array.
|
/* This is an array.
|
||||||
* Array elements are placed on vector[4] boundaries so they're
|
* Array elements are placed on vector[4] boundaries so they're
|
||||||
* a multiple of four floats. We round typeSize up to next multiple
|
* a multiple of four floats. We round typeSize up to next multiple
|
||||||
@@ -1726,7 +1726,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
|
|||||||
const GLint typeSize = sizeof_glsl_type(param->DataType);
|
const GLint typeSize = sizeof_glsl_type(param->DataType);
|
||||||
GLsizei k, i;
|
GLsizei k, i;
|
||||||
|
|
||||||
if (param->Size > typeSize) {
|
if ((GLint) param->Size > typeSize) {
|
||||||
/* an array */
|
/* an array */
|
||||||
/* we'll ignore extra data below */
|
/* we'll ignore extra data below */
|
||||||
}
|
}
|
||||||
@@ -1911,7 +1911,7 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program,
|
|||||||
GLuint mat, row, col;
|
GLuint mat, row, col;
|
||||||
GLuint src = 0;
|
GLuint src = 0;
|
||||||
const struct gl_program_parameter * param = &program->Parameters->Parameters[index];
|
const struct gl_program_parameter * param = &program->Parameters->Parameters[index];
|
||||||
const GLint slots = (param->Size + 3) / 4;
|
const GLuint slots = (param->Size + 3) / 4;
|
||||||
const GLint typeSize = sizeof_glsl_type(param->DataType);
|
const GLint typeSize = sizeof_glsl_type(param->DataType);
|
||||||
GLint nr, nc;
|
GLint nr, nc;
|
||||||
|
|
||||||
@@ -1923,7 +1923,7 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param->Size <= typeSize) {
|
if ((GLint) param->Size <= typeSize) {
|
||||||
/* non-array: count must be at most one; count == 0 is handled by the loop below */
|
/* non-array: count must be at most one; count == 0 is handled by the loop below */
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||||
|
@@ -3196,7 +3196,7 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper)
|
|||||||
newOper = slang_operation_new(1);
|
newOper = slang_operation_new(1);
|
||||||
newOper->type = SLANG_OPER_LITERAL_INT;
|
newOper->type = SLANG_OPER_LITERAL_INT;
|
||||||
newOper->literal_size = 1;
|
newOper->literal_size = 1;
|
||||||
newOper->literal[0] = iter;
|
newOper->literal[0] = (GLfloat) iter;
|
||||||
|
|
||||||
/* replace instances of the loop variable with newOper */
|
/* replace instances of the loop variable with newOper */
|
||||||
slang_substitute(A, body, 1, &oldVar, &newOper, GL_FALSE);
|
slang_substitute(A, body, 1, &oldVar, &newOper, GL_FALSE);
|
||||||
|
Reference in New Issue
Block a user