wined3d: Implement support for projective textures in ps 2.0 and later.

This commit is contained in:
Fabian Bieler 2007-03-29 18:44:57 +02:00 committed by Alexandre Julliard
parent bb00c95c45
commit 333de16fb6
3 changed files with 13 additions and 2 deletions

View file

@ -941,6 +941,9 @@ void shader_trace_init(
default:
TRACE("_(%u)", op);
}
} else if (curOpcode->opcode == WINED3DSIO_TEX &&
This->baseShader.hex_version >= WINED3DPS_VERSION(2,0)) {
if(opcode_token & WINED3DSI_TEXLD_PROJECT) TRACE("p");
}
/* Destination token */

View file

@ -1472,8 +1472,13 @@ void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) {
}
} else {
sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK;
/* TODO: Handle D3DSI_TEXLD_PROJECTED... */
projected = FALSE;
if(arg->opcode_token & WINED3DSI_TEXLD_PROJECT) {
/* ps 2.0 texldp instruction always divides by the fourth component. */
projected = TRUE;
mask = WINED3DSP_WRITEMASK_3;
} else {
projected = FALSE;
}
}
sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK;

View file

@ -291,6 +291,9 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
#define WINED3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x00010000
/** Shader version tokens, and shader end tokens **/
#define WINED3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))