wined3d: Implement MRTs in ARB.

This commit is contained in:
Stefan Dösinger 2009-06-18 18:10:15 +02:00 committed by Alexandre Julliard
parent bb8bcf5878
commit 26d17fe04c
3 changed files with 18 additions and 9 deletions

View File

@ -880,23 +880,22 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction
break;
case WINED3DSPR_COLOROUT:
if (reg->idx == 0)
if(ctx->cur_ps_args->super.srgb_correction && reg->idx == 0)
{
if(ctx->cur_ps_args->super.srgb_correction)
strcpy(register_name, "TMP_COLOR");
}
else
{
if(ctx->cur_ps_args->super.srgb_correction) FIXME("sRGB correction on higher render targets\n");
if(This->baseShader.reg_maps.highest_render_target > 0)
{
strcpy(register_name, "TMP_COLOR");
sprintf(register_name, "result.color[%u]", reg->idx);
}
else
{
strcpy(register_name, "result.color");
}
}
else
{
/* TODO: See GL_ARB_draw_buffers */
FIXME("Unsupported write to render target %u\n", reg->idx);
sprintf(register_name, "unsupported_register");
}
break;
case WINED3DSPR_RASTOUT:
@ -2957,6 +2956,11 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This,
priv_ctx.target_version = ARB;
}
if(This->baseShader.reg_maps.highest_render_target > 0)
{
shader_addline(buffer, "OPTION ARB_draw_buffers;\n");
}
if (reg_maps->shader_version.major < 3)
{
switch(args->super.fog) {

View File

@ -316,6 +316,10 @@ static void shader_record_register_usage(IWineD3DBaseShaderImpl *This, struct sh
reg_maps->boolean_constants |= (1 << reg->idx);
break;
case WINED3DSPR_COLOROUT:
reg_maps->highest_render_target = max(reg_maps->highest_render_target, reg->idx);
break;
default:
TRACE("Not recording register of type %#x and idx %u\n", reg->type, reg->idx);
break;

View File

@ -644,6 +644,7 @@ typedef struct shader_reg_maps
/* Whether or not loops are used in this shader, and nesting depth */
unsigned loop_depth;
unsigned highest_render_target;
} shader_reg_maps;