wined3d: Give tex_type and its values a better name.

This commit is contained in:
Stefan Dösinger 2015-04-02 00:30:49 +02:00 committed by Alexandre Julliard
parent 846febbc3d
commit 844c4efb47
6 changed files with 95 additions and 82 deletions

View File

@ -314,8 +314,8 @@ struct shader_arb_priv
const struct arb_ps_compiled_shader *compiled_fprog; const struct arb_ps_compiled_shader *compiled_fprog;
const struct arb_vs_compiled_shader *compiled_vprog; const struct arb_vs_compiled_shader *compiled_vprog;
GLuint depth_blt_vprogram_id; GLuint depth_blt_vprogram_id;
GLuint depth_blt_fprogram_id_full[tex_type_count]; GLuint depth_blt_fprogram_id_full[WINED3D_GL_RES_TYPE_COUNT];
GLuint depth_blt_fprogram_id_masked[tex_type_count]; GLuint depth_blt_fprogram_id_masked[WINED3D_GL_RES_TYPE_COUNT];
BOOL use_arbfp_fixed_func; BOOL use_arbfp_fixed_func;
struct wine_rb_tree fragment_shaders; struct wine_rb_tree fragment_shaders;
BOOL last_ps_const_clamped; BOOL last_ps_const_clamped;
@ -3320,31 +3320,31 @@ static GLuint create_arb_blt_vertex_program(const struct wined3d_gl_info *gl_inf
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_info, static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, BOOL masked) enum wined3d_gl_resource_type tex_type, BOOL masked)
{ {
GLuint program_id = 0; GLuint program_id = 0;
const char *fprogram; const char *fprogram;
GLint pos; GLint pos;
static const char * const blt_fprograms_full[tex_type_count] = static const char * const blt_fprograms_full[WINED3D_GL_RES_TYPE_COUNT] =
{ {
/* tex_1d */ /* WINED3D_GL_RES_TYPE_TEX_1D */
NULL, NULL,
/* tex_2d */ /* WINED3D_GL_RES_TYPE_TEX_2D */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"TEMP R0;\n" "TEMP R0;\n"
"TEX R0.x, fragment.texcoord[0], texture[0], 2D;\n" "TEX R0.x, fragment.texcoord[0], texture[0], 2D;\n"
"MOV result.depth.z, R0.x;\n" "MOV result.depth.z, R0.x;\n"
"END\n", "END\n",
/* tex_3d */ /* WINED3D_GL_RES_TYPE_TEX_3D */
NULL, NULL,
/* tex_cube */ /* WINED3D_GL_RES_TYPE_TEX_CUBE */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"TEMP R0;\n" "TEMP R0;\n"
"TEX R0.x, fragment.texcoord[0], texture[0], CUBE;\n" "TEX R0.x, fragment.texcoord[0], texture[0], CUBE;\n"
"MOV result.depth.z, R0.x;\n" "MOV result.depth.z, R0.x;\n"
"END\n", "END\n",
/* tex_rect */ /* WINED3D_GL_RES_TYPE_TEX_RECT */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"TEMP R0;\n" "TEMP R0;\n"
"TEX R0.x, fragment.texcoord[0], texture[0], RECT;\n" "TEX R0.x, fragment.texcoord[0], texture[0], RECT;\n"
@ -3352,11 +3352,11 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
"END\n", "END\n",
}; };
static const char * const blt_fprograms_masked[tex_type_count] = static const char * const blt_fprograms_masked[WINED3D_GL_RES_TYPE_COUNT] =
{ {
/* tex_1d */ /* WINED3D_GL_RES_TYPE_TEX_1D */
NULL, NULL,
/* tex_2d */ /* WINED3D_GL_RES_TYPE_TEX_2D */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"PARAM mask = program.local[0];\n" "PARAM mask = program.local[0];\n"
"TEMP R0;\n" "TEMP R0;\n"
@ -3366,9 +3366,9 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
"TEX R0.x, fragment.texcoord[0], texture[0], 2D;\n" "TEX R0.x, fragment.texcoord[0], texture[0], 2D;\n"
"MOV result.depth.z, R0.x;\n" "MOV result.depth.z, R0.x;\n"
"END\n", "END\n",
/* tex_3d */ /* WINED3D_GL_RES_TYPE_TEX_3D */
NULL, NULL,
/* tex_cube */ /* WINED3D_GL_RES_TYPE_TEX_CUBE */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"PARAM mask = program.local[0];\n" "PARAM mask = program.local[0];\n"
"TEMP R0;\n" "TEMP R0;\n"
@ -3378,7 +3378,7 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
"TEX R0.x, fragment.texcoord[0], texture[0], CUBE;\n" "TEX R0.x, fragment.texcoord[0], texture[0], CUBE;\n"
"MOV result.depth.z, R0.x;\n" "MOV result.depth.z, R0.x;\n"
"END\n", "END\n",
/* tex_rect */ /* WINED3D_GL_RES_TYPE_TEX_RECT */
"!!ARBfp1.0\n" "!!ARBfp1.0\n"
"PARAM mask = program.local[0];\n" "PARAM mask = program.local[0];\n"
"TEMP R0;\n" "TEMP R0;\n"
@ -3393,8 +3393,8 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
fprogram = masked ? blt_fprograms_masked[tex_type] : blt_fprograms_full[tex_type]; fprogram = masked ? blt_fprograms_masked[tex_type] : blt_fprograms_full[tex_type];
if (!fprogram) if (!fprogram)
{ {
FIXME("tex_type %#x not supported, falling back to tex_2d\n", tex_type); FIXME("tex_type %#x not supported, falling back to 2D\n", tex_type);
tex_type = tex_2d; tex_type = WINED3D_GL_RES_TYPE_TEX_2D;
fprogram = masked ? blt_fprograms_masked[tex_type] : blt_fprograms_full[tex_type]; fprogram = masked ? blt_fprograms_masked[tex_type] : blt_fprograms_full[tex_type];
} }
@ -4836,7 +4836,7 @@ static void shader_arb_disable(void *shader_priv, struct wined3d_context *contex
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void shader_arb_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info, static void shader_arb_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size) enum wined3d_gl_resource_type tex_type, const SIZE *ds_mask_size)
{ {
const float mask[] = {0.0f, 0.0f, (float)ds_mask_size->cx, (float)ds_mask_size->cy}; const float mask[] = {0.0f, 0.0f, (float)ds_mask_size->cx, (float)ds_mask_size->cy};
BOOL masked = ds_mask_size->cx && ds_mask_size->cy; BOOL masked = ds_mask_size->cx && ds_mask_size->cy;
@ -5039,7 +5039,7 @@ static void shader_arb_free(struct wined3d_device *device)
if (priv->depth_blt_vprogram_id) if (priv->depth_blt_vprogram_id)
GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_vprogram_id)); GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_vprogram_id));
for (i = 0; i < tex_type_count; ++i) for (i = 0; i < WINED3D_GL_RES_TYPE_COUNT; ++i)
{ {
if (priv->depth_blt_fprogram_id_full[i]) if (priv->depth_blt_fprogram_id_full[i])
{ {
@ -6345,13 +6345,26 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
if (!tex_read[stage]) if (!tex_read[stage])
continue; continue;
switch(settings->op[stage].tex_type) { switch(settings->op[stage].tex_type)
case tex_1d: textype = "1D"; break; {
case tex_2d: textype = "2D"; break; case WINED3D_GL_RES_TYPE_TEX_1D:
case tex_3d: textype = "3D"; break; textype = "1D";
case tex_cube: textype = "CUBE"; break; break;
case tex_rect: textype = "RECT"; break; case WINED3D_GL_RES_TYPE_TEX_2D:
default: textype = "unexpected_textype"; break; textype = "2D";
break;
case WINED3D_GL_RES_TYPE_TEX_3D:
textype = "3D";
break;
case WINED3D_GL_RES_TYPE_TEX_CUBE:
textype = "CUBE";
break;
case WINED3D_GL_RES_TYPE_TEX_RECT:
textype = "RECT";
break;
default:
textype = "unexpected_textype";
break;
} }
if(settings->op[stage].projected == proj_none) { if(settings->op[stage].projected == proj_none) {

View File

@ -96,8 +96,8 @@ struct shader_glsl_priv {
struct constant_heap vconst_heap; struct constant_heap vconst_heap;
struct constant_heap pconst_heap; struct constant_heap pconst_heap;
unsigned char *stack; unsigned char *stack;
GLuint depth_blt_program_full[tex_type_count]; GLuint depth_blt_program_full[WINED3D_GL_RES_TYPE_COUNT];
GLuint depth_blt_program_masked[tex_type_count]; GLuint depth_blt_program_masked[WINED3D_GL_RES_TYPE_COUNT];
UINT next_constant_version; UINT next_constant_version;
const struct wined3d_vertex_pipe_ops *vertex_pipe; const struct wined3d_vertex_pipe_ops *vertex_pipe;
@ -5570,19 +5570,19 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buf
switch (settings->op[stage].tex_type) switch (settings->op[stage].tex_type)
{ {
case tex_1d: case WINED3D_GL_RES_TYPE_TEX_1D:
shader_addline(buffer, "uniform sampler1D ps_sampler%u;\n", stage); shader_addline(buffer, "uniform sampler1D ps_sampler%u;\n", stage);
break; break;
case tex_2d: case WINED3D_GL_RES_TYPE_TEX_2D:
shader_addline(buffer, "uniform sampler2D ps_sampler%u;\n", stage); shader_addline(buffer, "uniform sampler2D ps_sampler%u;\n", stage);
break; break;
case tex_3d: case WINED3D_GL_RES_TYPE_TEX_3D:
shader_addline(buffer, "uniform sampler3D ps_sampler%u;\n", stage); shader_addline(buffer, "uniform sampler3D ps_sampler%u;\n", stage);
break; break;
case tex_cube: case WINED3D_GL_RES_TYPE_TEX_CUBE:
shader_addline(buffer, "uniform samplerCube ps_sampler%u;\n", stage); shader_addline(buffer, "uniform samplerCube ps_sampler%u;\n", stage);
break; break;
case tex_rect: case WINED3D_GL_RES_TYPE_TEX_RECT:
shader_addline(buffer, "uniform sampler2DRect ps_sampler%u;\n", stage); shader_addline(buffer, "uniform sampler2DRect ps_sampler%u;\n", stage);
break; break;
default: default:
@ -5647,7 +5647,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buf
switch (settings->op[stage].tex_type) switch (settings->op[stage].tex_type)
{ {
case tex_1d: case WINED3D_GL_RES_TYPE_TEX_1D:
if (proj) if (proj)
{ {
texture_function = "texture1DProj"; texture_function = "texture1DProj";
@ -5659,7 +5659,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buf
coord_mask = "x"; coord_mask = "x";
} }
break; break;
case tex_2d: case WINED3D_GL_RES_TYPE_TEX_2D:
if (proj) if (proj)
{ {
texture_function = "texture2DProj"; texture_function = "texture2DProj";
@ -5671,7 +5671,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buf
coord_mask = "xy"; coord_mask = "xy";
} }
break; break;
case tex_3d: case WINED3D_GL_RES_TYPE_TEX_3D:
if (proj) if (proj)
{ {
texture_function = "texture3DProj"; texture_function = "texture3DProj";
@ -5683,11 +5683,11 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buf
coord_mask = "xyz"; coord_mask = "xyz";
} }
break; break;
case tex_cube: case WINED3D_GL_RES_TYPE_TEX_CUBE:
texture_function = "textureCube"; texture_function = "textureCube";
coord_mask = "xyz"; coord_mask = "xyz";
break; break;
case tex_rect: case WINED3D_GL_RES_TYPE_TEX_RECT:
if (proj) if (proj)
{ {
texture_function = "texture2DRectProj"; texture_function = "texture2DRectProj";
@ -6249,7 +6249,8 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum tex_types tex_type, BOOL masked) static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum wined3d_gl_resource_type tex_type,
BOOL masked)
{ {
GLuint program_id; GLuint program_id;
GLuint vshader_id, pshader_id; GLuint vshader_id, pshader_id;
@ -6264,27 +6265,27 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
" gl_TexCoord[0] = gl_MultiTexCoord0;\n" " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
"}\n"; "}\n";
static const char * const blt_pshaders_full[tex_type_count] = static const char * const blt_pshaders_full[WINED3D_GL_RES_TYPE_COUNT] =
{ {
/* tex_1d */ /* WINED3D_GL_RES_TYPE_TEX_1D */
NULL, NULL,
/* tex_2d */ /* WINED3D_GL_RES_TYPE_TEX_2D */
"#version 120\n" "#version 120\n"
"uniform sampler2D sampler;\n" "uniform sampler2D sampler;\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" gl_FragDepth = texture2D(sampler, gl_TexCoord[0].xy).x;\n" " gl_FragDepth = texture2D(sampler, gl_TexCoord[0].xy).x;\n"
"}\n", "}\n",
/* tex_3d */ /* WINED3D_GL_RES_TYPE_TEX_3D */
NULL, NULL,
/* tex_cube */ /* WINED3D_GL_RES_TYPE_TEX_CUBE */
"#version 120\n" "#version 120\n"
"uniform samplerCube sampler;\n" "uniform samplerCube sampler;\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" gl_FragDepth = textureCube(sampler, gl_TexCoord[0].xyz).x;\n" " gl_FragDepth = textureCube(sampler, gl_TexCoord[0].xyz).x;\n"
"}\n", "}\n",
/* tex_rect */ /* WINED3D_GL_RES_TYPE_TEX_RECT */
"#version 120\n" "#version 120\n"
"#extension GL_ARB_texture_rectangle : enable\n" "#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect sampler;\n" "uniform sampler2DRect sampler;\n"
@ -6294,11 +6295,11 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
"}\n", "}\n",
}; };
static const char * const blt_pshaders_masked[tex_type_count] = static const char * const blt_pshaders_masked[WINED3D_GL_RES_TYPE_COUNT] =
{ {
/* tex_1d */ /* WINED3D_GL_RES_TYPE_TEX_1D */
NULL, NULL,
/* tex_2d */ /* WINED3D_GL_RES_TYPE_TEX_2D */
"#version 120\n" "#version 120\n"
"uniform sampler2D sampler;\n" "uniform sampler2D sampler;\n"
"uniform vec4 mask;\n" "uniform vec4 mask;\n"
@ -6307,9 +6308,9 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
" if (all(lessThan(gl_FragCoord.xy, mask.zw))) discard;\n" " if (all(lessThan(gl_FragCoord.xy, mask.zw))) discard;\n"
" gl_FragDepth = texture2D(sampler, gl_TexCoord[0].xy).x;\n" " gl_FragDepth = texture2D(sampler, gl_TexCoord[0].xy).x;\n"
"}\n", "}\n",
/* tex_3d */ /* WINED3D_GL_RES_TYPE_TEX_3D */
NULL, NULL,
/* tex_cube */ /* WINED3D_GL_RES_TYPE_TEX_CUBE */
"#version 120\n" "#version 120\n"
"uniform samplerCube sampler;\n" "uniform samplerCube sampler;\n"
"uniform vec4 mask;\n" "uniform vec4 mask;\n"
@ -6318,7 +6319,7 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
" if (all(lessThan(gl_FragCoord.xy, mask.zw))) discard;\n" " if (all(lessThan(gl_FragCoord.xy, mask.zw))) discard;\n"
" gl_FragDepth = textureCube(sampler, gl_TexCoord[0].xyz).x;\n" " gl_FragDepth = textureCube(sampler, gl_TexCoord[0].xyz).x;\n"
"}\n", "}\n",
/* tex_rect */ /* WINED3D_GL_RES_TYPE_TEX_RECT */
"#version 120\n" "#version 120\n"
"#extension GL_ARB_texture_rectangle : enable\n" "#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect sampler;\n" "uniform sampler2DRect sampler;\n"
@ -6453,7 +6454,7 @@ static void shader_glsl_disable(void *shader_priv, struct wined3d_context *conte
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void shader_glsl_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info, static void shader_glsl_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size) enum wined3d_gl_resource_type tex_type, const SIZE *ds_mask_size)
{ {
BOOL masked = ds_mask_size->cx && ds_mask_size->cy; BOOL masked = ds_mask_size->cx && ds_mask_size->cy;
struct shader_glsl_priv *priv = shader_priv; struct shader_glsl_priv *priv = shader_priv;
@ -6756,7 +6757,7 @@ static void shader_glsl_free(struct wined3d_device *device)
struct shader_glsl_priv *priv = device->shader_priv; struct shader_glsl_priv *priv = device->shader_priv;
int i; int i;
for (i = 0; i < tex_type_count; ++i) for (i = 0; i < WINED3D_GL_RES_TYPE_COUNT; ++i)
{ {
if (priv->depth_blt_program_full[i]) if (priv->depth_blt_program_full[i])
{ {

View File

@ -1837,7 +1837,7 @@ struct shader_none_priv
static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {} static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {}
static void shader_none_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info, static void shader_none_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size) {} enum wined3d_gl_resource_type tex_type, const SIZE *ds_mask_size) {}
static void shader_none_deselect_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info) {} static void shader_none_deselect_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info) {}
static void shader_none_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count) {} static void shader_none_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count) {}
static void shader_none_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count) {} static void shader_none_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count) {}

View File

@ -146,7 +146,7 @@ struct blt_info
{ {
GLenum binding; GLenum binding;
GLenum bind_target; GLenum bind_target;
enum tex_types tex_type; enum wined3d_gl_resource_type tex_type;
GLfloat coords[4][3]; GLfloat coords[4][3];
}; };
@ -179,7 +179,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
info->binding = GL_TEXTURE_BINDING_2D; info->binding = GL_TEXTURE_BINDING_2D;
info->bind_target = GL_TEXTURE_2D; info->bind_target = GL_TEXTURE_2D;
info->tex_type = tex_2d; info->tex_type = WINED3D_GL_RES_TYPE_TEX_2D;
coords[0][0] = (float)rect->left / w; coords[0][0] = (float)rect->left / w;
coords[0][1] = (float)rect->top / h; coords[0][1] = (float)rect->top / h;
coords[0][2] = 0.0f; coords[0][2] = 0.0f;
@ -200,7 +200,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_RECTANGLE_ARB: case GL_TEXTURE_RECTANGLE_ARB:
info->binding = GL_TEXTURE_BINDING_RECTANGLE_ARB; info->binding = GL_TEXTURE_BINDING_RECTANGLE_ARB;
info->bind_target = GL_TEXTURE_RECTANGLE_ARB; info->bind_target = GL_TEXTURE_RECTANGLE_ARB;
info->tex_type = tex_rect; info->tex_type = WINED3D_GL_RES_TYPE_TEX_RECT;
coords[0][0] = rect->left; coords[0][1] = rect->top; coords[0][2] = 0.0f; coords[0][0] = rect->left; coords[0][1] = rect->top; coords[0][2] = 0.0f;
coords[1][0] = rect->right; coords[1][1] = rect->top; coords[1][2] = 0.0f; coords[1][0] = rect->right; coords[1][1] = rect->top; coords[1][2] = 0.0f;
coords[2][0] = rect->left; coords[2][1] = rect->bottom; coords[2][2] = 0.0f; coords[2][0] = rect->left; coords[2][1] = rect->bottom; coords[2][2] = 0.0f;
@ -210,7 +210,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_POSITIVE_X: case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = 1.0f; coords[0][1] = -f.t; coords[0][2] = -f.l; coords[0][0] = 1.0f; coords[0][1] = -f.t; coords[0][2] = -f.l;
@ -222,7 +222,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = -1.0f; coords[0][1] = -f.t; coords[0][2] = f.l; coords[0][0] = -1.0f; coords[0][1] = -f.t; coords[0][2] = f.l;
@ -234,7 +234,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = f.l; coords[0][1] = 1.0f; coords[0][2] = f.t; coords[0][0] = f.l; coords[0][1] = 1.0f; coords[0][2] = f.t;
@ -246,7 +246,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = f.l; coords[0][1] = -1.0f; coords[0][2] = -f.t; coords[0][0] = f.l; coords[0][1] = -1.0f; coords[0][2] = -f.t;
@ -258,7 +258,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = f.l; coords[0][1] = -f.t; coords[0][2] = 1.0f; coords[0][0] = f.l; coords[0][1] = -f.t; coords[0][2] = 1.0f;
@ -270,7 +270,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect, GLsizei w, GLs
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB;
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
info->tex_type = tex_cube; info->tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
cube_coords_float(rect, w, h, &f); cube_coords_float(rect, w, h, &f);
coords[0][0] = -f.l; coords[0][1] = -f.t; coords[0][2] = -1.0f; coords[0][0] = -f.l; coords[0][1] = -f.t; coords[0][2] = -1.0f;

View File

@ -3637,7 +3637,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED; settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED;
settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY; settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
settings->op[i].dst = resultreg; settings->op[i].dst = resultreg;
settings->op[i].tex_type = tex_1d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
settings->op[i].projected = proj_none; settings->op[i].projected = proj_none;
i++; i++;
break; break;
@ -3648,32 +3648,32 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
settings->op[i].color_fixup = texture->resource.format->color_fixup; settings->op[i].color_fixup = texture->resource.format->color_fixup;
if (ignore_textype) if (ignore_textype)
{ {
settings->op[i].tex_type = tex_1d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
} }
else else
{ {
switch (texture->target) switch (texture->target)
{ {
case GL_TEXTURE_1D: case GL_TEXTURE_1D:
settings->op[i].tex_type = tex_1d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
break; break;
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
settings->op[i].tex_type = tex_2d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_2D;
break; break;
case GL_TEXTURE_3D: case GL_TEXTURE_3D:
settings->op[i].tex_type = tex_3d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_3D;
break; break;
case GL_TEXTURE_CUBE_MAP_ARB: case GL_TEXTURE_CUBE_MAP_ARB:
settings->op[i].tex_type = tex_cube; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
break; break;
case GL_TEXTURE_RECTANGLE_ARB: case GL_TEXTURE_RECTANGLE_ARB:
settings->op[i].tex_type = tex_rect; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_RECT;
break; break;
} }
} }
} else { } else {
settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY; settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
settings->op[i].tex_type = tex_1d; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
} }
cop = state->texture_states[i][WINED3D_TSS_COLOR_OP]; cop = state->texture_states[i][WINED3D_TSS_COLOR_OP];

View File

@ -772,14 +772,14 @@ struct shader_caps
DWORD wined3d_caps; DWORD wined3d_caps;
}; };
enum tex_types enum wined3d_gl_resource_type
{ {
tex_1d = 0, WINED3D_GL_RES_TYPE_TEX_1D = 0,
tex_2d = 1, WINED3D_GL_RES_TYPE_TEX_2D = 1,
tex_3d = 2, WINED3D_GL_RES_TYPE_TEX_3D = 2,
tex_cube = 3, WINED3D_GL_RES_TYPE_TEX_CUBE = 3,
tex_rect = 4, WINED3D_GL_RES_TYPE_TEX_RECT = 4,
tex_type_count = 5, WINED3D_GL_RES_TYPE_COUNT = 5,
}; };
enum vertexprocessing_mode { enum vertexprocessing_mode {
@ -808,9 +808,8 @@ enum wined3d_ffp_ps_fog_mode
#define WINED3D_PSARGS_TEXTYPE_SHIFT 2 #define WINED3D_PSARGS_TEXTYPE_SHIFT 2
#define WINED3D_PSARGS_TEXTYPE_MASK 0x3 #define WINED3D_PSARGS_TEXTYPE_MASK 0x3
/* Similar to tex_types, except that it doesn't have 1d textures /* Used for Shader Model 1 pixel shaders to track the bound texture
* (can't be bound), rect textures (handled via np2_fixup) and * type. 2D and RECT textures are separated through NP2 fixup. */
* none / unknown (treated as 2d and handled via dummy textures). */
enum wined3d_shader_tex_types enum wined3d_shader_tex_types
{ {
WINED3D_SHADER_TEX_2D = 0, WINED3D_SHADER_TEX_2D = 0,
@ -855,7 +854,7 @@ struct wined3d_shader_backend_ops
const struct wined3d_state *state); const struct wined3d_state *state);
void (*shader_disable)(void *shader_priv, struct wined3d_context *context); void (*shader_disable)(void *shader_priv, struct wined3d_context *context);
void (*shader_select_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info, void (*shader_select_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size); enum wined3d_gl_resource_type tex_type, const SIZE *ds_mask_size);
void (*shader_deselect_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info); void (*shader_deselect_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info);
void (*shader_update_float_vertex_constants)(struct wined3d_device *device, UINT start, UINT count); void (*shader_update_float_vertex_constants)(struct wined3d_device *device, UINT start, UINT count);
void (*shader_update_float_pixel_constants)(struct wined3d_device *device, UINT start, UINT count); void (*shader_update_float_pixel_constants)(struct wined3d_device *device, UINT start, UINT count);