wined3d: Support ABS and ABSNEG with NV extensions if available.

This commit is contained in:
Stefan Dösinger 2009-05-21 12:00:16 +02:00 committed by Alexandre Julliard
parent 01ec5068e2
commit d0756ee537
1 changed files with 13 additions and 3 deletions

View File

@ -811,6 +811,7 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in
char swzstr[20];
int insert_line;
SHADER_BUFFER *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
/* Assume a new line will be added */
insert_line = 1;
@ -859,11 +860,20 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in
shader_addline(buffer, "MUL T%c, %s, T%c;\n", 'A' + tmpreg, regstr, 'A' + tmpreg);
break;
case WINED3DSPSM_ABS:
shader_addline(buffer, "ABS T%c, %s;\n", 'A' + tmpreg, regstr);
if(ctx->target_version >= NV2) {
sprintf(outregstr, "|%s%s|", regstr, swzstr);
insert_line = 0;
} else {
shader_addline(buffer, "ABS T%c, %s;\n", 'A' + tmpreg, regstr);
}
break;
case WINED3DSPSM_ABSNEG:
shader_addline(buffer, "ABS T%c, %s;\n", 'A' + tmpreg, regstr);
sprintf(outregstr, "-T%c%s", 'A' + tmpreg, swzstr);
if(ctx->target_version >= NV2) {
sprintf(outregstr, "-|%s%s|", regstr, swzstr);
} else {
shader_addline(buffer, "ABS T%c, %s;\n", 'A' + tmpreg, regstr);
sprintf(outregstr, "-T%c%s", 'A' + tmpreg, swzstr);
}
insert_line = 0;
break;
default: