mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
wined3d: Use COLOROUT/DEPTHOUT for pixel shaders 2.0+.
As previously mentioned, RASTOUT is invalid on pixel shaders. On shaders 1.x, r0 is treated as the color output register: http://www.gamedev.net/columns/hardcore/dxshader3/page2.asp That's what we currently do in all cases, change it not to do so for shaders >= 2.0. Support COLOROUT/DEPTHOUT instead.
This commit is contained in:
parent
174734e4a2
commit
c65a86828c
@ -745,7 +745,6 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline static void get_register_name(const DWORD param, char* regstr, char constants[WINED3D_PSHADER_MAX_CONSTANTS]) {
|
inline static void get_register_name(const DWORD param, char* regstr, char constants[WINED3D_PSHADER_MAX_CONSTANTS]) {
|
||||||
static const char* rastout_reg_names[] = { "oC0", "oC1", "oC2", "oC3", "oDepth" };
|
|
||||||
|
|
||||||
DWORD reg = param & D3DSP_REGNUM_MASK;
|
DWORD reg = param & D3DSP_REGNUM_MASK;
|
||||||
DWORD regtype = shader_get_regtype(param);
|
DWORD regtype = shader_get_regtype(param);
|
||||||
@ -770,8 +769,17 @@ inline static void get_register_name(const DWORD param, char* regstr, char const
|
|||||||
case D3DSPR_TEXTURE: /* case D3DSPR_ADDR: */
|
case D3DSPR_TEXTURE: /* case D3DSPR_ADDR: */
|
||||||
sprintf(regstr,"T%lu", reg);
|
sprintf(regstr,"T%lu", reg);
|
||||||
break;
|
break;
|
||||||
case D3DSPR_RASTOUT:
|
case D3DSPR_COLOROUT:
|
||||||
sprintf(regstr, "%s", rastout_reg_names[reg]);
|
if (reg == 0)
|
||||||
|
sprintf(regstr, "result.color");
|
||||||
|
else {
|
||||||
|
/* TODO: See GL_ARB_draw_buffers */
|
||||||
|
FIXME("Unsupported write to render target %lu\n", reg);
|
||||||
|
sprintf(regstr, "unsupported_register");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case D3DSPR_DEPTHOUT:
|
||||||
|
sprintf(regstr, "result.depth");
|
||||||
break;
|
break;
|
||||||
case D3DSPR_ATTROUT:
|
case D3DSPR_ATTROUT:
|
||||||
sprintf(regstr, "oD[%lu]", reg);
|
sprintf(regstr, "oD[%lu]", reg);
|
||||||
@ -1341,7 +1349,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateShader(
|
|||||||
of the pixel shader string for us */
|
of the pixel shader string for us */
|
||||||
generate_base_shader( (IWineD3DBaseShader*) This, &buffer, pFunction);
|
generate_base_shader( (IWineD3DBaseShader*) This, &buffer, pFunction);
|
||||||
|
|
||||||
/*FIXME: This next line isn't valid for certain pixel shader versions */
|
if (This->baseShader.hex_version < D3DPS_VERSION(2,0))
|
||||||
shader_addline(&buffer, "MOV result.color, R0;\n");
|
shader_addline(&buffer, "MOV result.color, R0;\n");
|
||||||
shader_addline(&buffer, "END\n\0");
|
shader_addline(&buffer, "END\n\0");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user