Commit 333de16f authored by Fabian Bieler's avatar Fabian Bieler Committed by Alexandre Julliard

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

parent bb00c95c
...@@ -941,6 +941,9 @@ void shader_trace_init( ...@@ -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,8 +1472,13 @@ void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { ...@@ -1472,8 +1472,13 @@ 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) {
projected = FALSE; /* 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; sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK;
......
...@@ -291,6 +291,9 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE { ...@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment