wined3d: Implement D3DSPDM_PARTIALPRECISION support.

This commit is contained in:
Stefan Doesinger 2009-05-28 19:42:24 +02:00 committed by Alexandre Julliard
parent dfd338de77
commit a7b605af64
1 changed files with 29 additions and 15 deletions

View File

@ -913,30 +913,38 @@ static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, DWORD d
static const char *shader_arb_get_modifier(const struct wined3d_shader_instruction *ins) static const char *shader_arb_get_modifier(const struct wined3d_shader_instruction *ins)
{ {
DWORD mod; DWORD mod;
const char *ret = ""; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
if (!ins->dst_count) return ""; if (!ins->dst_count) return "";
mod = ins->dst[0].modifiers; mod = ins->dst[0].modifiers;
if(mod & WINED3DSPDM_SATURATE)
{ /* Silently ignore PARTIALPRECISION if its not supported */
ret = "_SAT"; if(priv->target_version == ARB) mod &= ~WINED3DSPDM_PARTIALPRECISION;
mod &= ~WINED3DSPDM_SATURATE;
}
if(mod & WINED3DSPDM_PARTIALPRECISION)
{
FIXME("Unhandled modifier WINED3DSPDM_PARTIALPRECISION\n");
mod &= ~WINED3DSPDM_PARTIALPRECISION;
}
if(mod & WINED3DSPDM_MSAMPCENTROID) if(mod & WINED3DSPDM_MSAMPCENTROID)
{ {
FIXME("Unhandled modifier WINED3DSPDM_MSAMPCENTROID\n"); FIXME("Unhandled modifier WINED3DSPDM_MSAMPCENTROID\n");
mod &= ~WINED3DSPDM_MSAMPCENTROID; mod &= ~WINED3DSPDM_MSAMPCENTROID;
} }
if(mod)
switch(mod)
{ {
FIXME("Unknown modifiers 0x%08x\n", mod); case WINED3DSPDM_SATURATE | WINED3DSPDM_PARTIALPRECISION:
return "H_SAT";
case WINED3DSPDM_SATURATE:
return "_SAT";
case WINED3DSPDM_PARTIALPRECISION:
return "H";
case 0:
return "";
default:
FIXME("Unknown modifiers 0x%08x\n", mod);
return "";
} }
return ret;
} }
#define TEX_PROJ 0x1 #define TEX_PROJ 0x1
@ -953,7 +961,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
const char *mod = shader_arb_get_modifier(ins); const char *mod;
switch(sampler_type) { switch(sampler_type) {
case WINED3DSTT_1D: case WINED3DSTT_1D:
@ -989,6 +997,12 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
tex_type = ""; tex_type = "";
} }
/* TEX, TXL, TXD and TXP do not support the "H" modifier,
* so don't use shader_arb_get_modifier
*/
if(ins->dst[0].modifiers & WINED3DSPDM_SATURATE) mod = "_SAT";
else mod = "";
if (flags & TEX_DERIV) if (flags & TEX_DERIV)
{ {
if(flags & TEX_PROJ) FIXME("Projected texture sampling with custom derivates\n"); if(flags & TEX_PROJ) FIXME("Projected texture sampling with custom derivates\n");