wined3d: Pass the texture type to the shader depth blt function.

This commit is contained in:
Henri Verbeet 2008-10-27 18:31:31 +01:00 committed by Alexandre Julliard
parent 4034a29f19
commit 57401fcab2
5 changed files with 19 additions and 14 deletions

View File

@ -1880,11 +1880,13 @@ static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
}
}
static void shader_arb_select_depth_blt(IWineD3DDevice *iface) {
static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
if (tex_type != tex_2d) FIXME("Unsupported tex_type %#x\n", tex_type);
if (!priv->depth_blt_vprogram_id) priv->depth_blt_vprogram_id = create_arb_blt_vertex_program(gl_info);
GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->depth_blt_vprogram_id));
glEnable(GL_VERTEX_PROGRAM_ARB);

View File

@ -1092,7 +1092,7 @@ void shader_trace_init(
static const SHADER_HANDLER shader_none_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = {0};
static void shader_none_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {}
static void shader_none_select_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {}
static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {}
static void shader_none_cleanup(IWineD3DDevice *iface) {}

View File

@ -3454,11 +3454,13 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
checkGLcall("glUseProgramObjectARB");
}
static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv;
if (tex_type != tex_2d) FIXME("Unsupported tex_type %#x\n", tex_type);
if (!priv->depth_blt_glsl_program_id) {
GLhandleARB loc;
priv->depth_blt_glsl_program_id = create_glsl_blt_shader(gl_info);

View File

@ -3976,7 +3976,7 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei
glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
glBindTexture(GL_TEXTURE_2D, texture);
device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device);
device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device, tex_2d);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(-1.0f, -1.0f);

View File

@ -323,10 +323,20 @@ struct shader_caps {
DWORD MaxPixelShader30InstructionSlots;
};
enum tex_types
{
tex_1d = 0,
tex_2d = 1,
tex_3d = 2,
tex_cube = 3,
tex_rect = 4,
tex_type_count = 5,
};
typedef struct {
const SHADER_HANDLER *shader_instruction_handler_table;
void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS);
void (*shader_select_depth_blt)(IWineD3DDevice *iface);
void (*shader_select_depth_blt)(IWineD3DDevice *iface, enum tex_types tex_type);
void (*shader_deselect_depth_blt)(IWineD3DDevice *iface);
void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS);
void (*shader_cleanup)(IWineD3DDevice *iface);
@ -821,15 +831,6 @@ enum projection_types
proj_count4 = 2
};
enum tex_types
{
tex_1d = 0,
tex_2d = 1,
tex_3d = 2,
tex_cube = 3,
tex_rect = 4
};
enum dst_arg
{
resultreg = 0,