mesa: add GLSL support for DP2, NRM3, NRM4 instructions (not actually emitted yet though)

This commit is contained in:
Brian Paul
2008-11-07 09:49:26 -07:00
parent 65cb74ecc0
commit a98a25c25f
4 changed files with 18 additions and 3 deletions
+3
View File
@@ -413,6 +413,9 @@ static slang_asm_info AsmInfo[] = {
{ "vec4_multiply", IR_MUL, 1, 2 },
{ "vec4_dot", IR_DOT4, 1, 2 },
{ "vec3_dot", IR_DOT3, 1, 2 },
{ "vec2_dot", IR_DOT2, 1, 2 },
{ "vec3_nrm", IR_NRM3, 1, 1 },
{ "vec4_nrm", IR_NRM4, 1, 1 },
{ "vec3_cross", IR_CROSS, 1, 2 },
{ "vec4_lrp", IR_LRP, 1, 3 },
{ "vec4_min", IR_MIN, 1, 2 },
+7 -1
View File
@@ -488,6 +488,9 @@ instruction_annotation(gl_inst_opcode opcode, char *dstAnnot,
case OPCODE_MUL:
operator = "*";
break;
case OPCODE_DP2:
operator = "DP2";
break;
case OPCODE_DP3:
operator = "DP3";
break;
@@ -708,7 +711,7 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n)
}
else {
assert(size == 2);
dotOp = OPCODE_DP3;
dotOp = OPCODE_DP3; /* XXX use OPCODE_DP2 eventually */
swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y);
}
@@ -1893,12 +1896,15 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
case IR_NOISE2:
case IR_NOISE3:
case IR_NOISE4:
case IR_NRM4:
case IR_NRM3:
/* binary */
case IR_ADD:
case IR_SUB:
case IR_MUL:
case IR_DOT4:
case IR_DOT3:
case IR_DOT2:
case IR_CROSS:
case IR_MIN:
case IR_MAX:
+5 -2
View File
@@ -37,8 +37,11 @@ static const slang_ir_info IrInfo[] = {
{ IR_SUB, "IR_SUB", OPCODE_SUB, 4, 2 },
{ IR_MUL, "IR_MUL", OPCODE_MUL, 4, 2 },
{ IR_DIV, "IR_DIV", OPCODE_NOP, 0, 2 }, /* XXX broke */
{ IR_DOT4, "IR_DOT_4", OPCODE_DP4, 1, 2 },
{ IR_DOT3, "IR_DOT_3", OPCODE_DP3, 1, 2 },
{ IR_DOT4, "IR_DOT4", OPCODE_DP4, 1, 2 },
{ IR_DOT3, "IR_DOT3", OPCODE_DP3, 1, 2 },
{ IR_DOT2, "IR_DOT2", OPCODE_DP2, 1, 2 },
{ IR_NRM4, "IR_NRM4", OPCODE_NRM4, 1, 1 },
{ IR_NRM3, "IR_NRM3", OPCODE_NRM3, 1, 1 },
{ IR_CROSS, "IR_CROSS", OPCODE_XPD, 3, 2 },
{ IR_LRP, "IR_LRP", OPCODE_LRP, 4, 3 },
{ IR_MIN, "IR_MIN", OPCODE_MIN, 4, 2 },
+3
View File
@@ -83,6 +83,9 @@ typedef enum
IR_DIV,
IR_DOT4,
IR_DOT3,
IR_DOT2,
IR_NRM4,
IR_NRM3,
IR_CROSS, /* vec3 cross product */
IR_LRP,
IR_CLAMP,