wined3d: Implement support for projective textures in ps 2.0 and later.
This commit is contained in:
parent
bb00c95c45
commit
333de16fb6
|
@ -941,6 +941,9 @@ void shader_trace_init(
|
||||||
default:
|
default:
|
||||||
TRACE("_(%u)", op);
|
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 */
|
/* Destination token */
|
||||||
|
|
|
@ -1472,9 +1472,14 @@ void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK;
|
sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK;
|
||||||
/* TODO: Handle D3DSI_TEXLD_PROJECTED... */
|
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;
|
projected = FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK;
|
sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK;
|
||||||
shader_glsl_get_sample_function(sampler_type, projected, &sample_function);
|
shader_glsl_get_sample_function(sampler_type, projected, &sample_function);
|
||||||
|
|
|
@ -291,6 +291,9 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
|
||||||
|
|
||||||
#define WINED3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
|
#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 **/
|
/** Shader version tokens, and shader end tokens **/
|
||||||
|
|
||||||
#define WINED3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
|
#define WINED3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
|
||||||
|
|
Loading…
Reference in New Issue