Changeset 37550 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 20, 2011 9:00:06 AM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/arb_program_shader.c
r37394 r37550 1855 1855 { 1856 1856 DWORD flags = 0; 1857 struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; 1858 1857 1859 if(reg_sampler_code < MAX_TEXTURES) { 1858 flags = deviceImpl->stateBlock->textureState[reg_sampler_code][WINED3DTSS_TEXTURETRANSFORMFLAGS];1859 } 1860 if (flags & WINED3D TTFF_PROJECTED) {1860 flags = priv->cur_ps_args->super.tex_transform >> (reg_sampler_code*WINED3D_PSARGS_TEXTRANSFORM_SHIFT); 1861 } 1862 if (flags & WINED3D_PSARGS_PROJECTED) { 1861 1863 myflags |= TEX_PROJ; 1862 1864 } … … 1910 1912 IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader; 1911 1913 IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device; 1912 DWORD flags ;1914 DWORD flags=0; 1913 1915 1914 1916 DWORD reg1 = ins->dst[0].reg.idx; … … 1922 1924 shader_addline(buffer, "MOV TA.y, %s.x;\n", src_str); 1923 1925 shader_addline(buffer, "MOV TA.x, %s.w;\n", src_str); 1924 flags = reg1 < MAX_TEXTURES ? deviceImpl->stateBlock->textureState[reg1][WINED3DTSS_TEXTURETRANSFORMFLAGS] : 0; 1925 shader_hw_sample(ins, reg1, dst_str, "TA", flags & WINED3DTTFF_PROJECTED ? TEX_PROJ : 0, NULL, NULL); 1926 1927 if (reg1 < MAX_TEXTURES) 1928 { 1929 struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; 1930 flags = priv->cur_ps_args->super.tex_transform >> (reg1 * WINED3D_PSARGS_TEXTRANSFORM_SHIFT); 1931 } 1932 1933 shader_hw_sample(ins, reg1, dst_str, "TA", flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL); 1926 1934 } 1927 1935 … … 1960 1968 const struct wined3d_shader_dst_param *dst = &ins->dst[0]; 1961 1969 struct wined3d_shader_buffer *buffer = ins->ctx->buffer; 1970 struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; 1962 1971 char reg_coord[40], dst_reg[50], src_reg[50]; 1963 1972 DWORD reg_dest_code; 1973 DWORD flags; 1964 1974 1965 1975 /* All versions have a destination register. The Tx where the texture coordinates come … … 1989 1999 * so we can't let the GL handle this. 1990 2000 */ 1991 if (device->stateBlock->textureState[reg_dest_code][WINED3DTSS_TEXTURETRANSFORMFLAGS] & WINED3DTTFF_PROJECTED) 2001 flags = priv->cur_ps_args->super.tex_transform >> (reg_dest_code * WINED3D_PSARGS_TEXTRANSFORM_SHIFT); 2002 if (flags & WINED3D_PSARGS_PROJECTED) 1992 2003 { 1993 2004 shader_addline(buffer, "RCP TB.w, %s.w;\n", reg_coord); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c
r35825 r37550 2987 2987 if (shader_version < WINED3D_SHADER_VERSION(1,4)) 2988 2988 { 2989 DWORD flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS]; 2989 const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; 2990 DWORD flags = (priv->cur_ps_args->tex_transform >> (sampler_idx * WINED3D_PSARGS_TEXTRANSFORM_SHIFT)) 2991 & WINED3D_PSARGS_TEXTRANSFORM_MASK; 2990 2992 2991 2993 /* Projected cube textures don't make a lot of sense, the resulting coordinates stay the same. */ 2992 if (flags & WINED3D TTFF_PROJECTED && sampler_type != WINED3DSTT_CUBE) {2994 if (flags & WINED3D_PSARGS_PROJECTED && sampler_type != WINED3DSTT_CUBE) { 2993 2995 sample_flags |= WINED3D_GLSL_SAMPLE_PROJECTED; 2994 switch (flags & ~WINED3D TTFF_PROJECTED) {2996 switch (flags & ~WINED3D_PSARGS_PROJECTED) { 2995 2997 case WINED3DTTFF_COUNT1: FIXME("WINED3DTTFF_PROJECTED with WINED3DTTFF_COUNT1?\n"); break; 2996 2998 case WINED3DTTFF_COUNT2: mask = WINED3DSP_WRITEMASK_1; break; … … 3439 3441 IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *)shader->baseShader.device; 3440 3442 const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; 3443 const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; 3441 3444 glsl_sample_function_t sample_function; 3442 3445 glsl_src_param_t coord_param; … … 3448 3451 3449 3452 sampler_idx = ins->dst[0].reg.idx; 3450 flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS]; 3453 flags = (priv->cur_ps_args->tex_transform >> (sampler_idx * WINED3D_PSARGS_TEXTRANSFORM_SHIFT)) 3454 & WINED3D_PSARGS_TEXTRANSFORM_MASK; 3451 3455 3452 3456 sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx]; … … 3460 3464 * so we can't let the GL handle this. 3461 3465 */ 3462 if (flags & WINED3D TTFF_PROJECTED) {3466 if (flags & WINED3D_PSARGS_PROJECTED) { 3463 3467 DWORD div_mask=0; 3464 3468 char coord_div_mask[3]; 3465 switch (flags & ~WINED3D TTFF_PROJECTED) {3469 switch (flags & ~WINED3D_PSARGS_PROJECTED) { 3466 3470 case WINED3DTTFF_COUNT1: FIXME("WINED3DTTFF_PROJECTED with WINED3DTTFF_COUNT1?\n"); break; 3467 3471 case WINED3DTTFF_COUNT2: div_mask = WINED3DSP_WRITEMASK_1; break; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/shader.c
r33656 r37550 2022 2022 args->t_mirror = 0; 2023 2023 2024 if (shader->baseShader.reg_maps.shader_version.major==1 2025 && shader->baseShader.reg_maps.shader_version.minor<=3) 2026 { 2027 for (i=0; i<4; ++i) 2028 { 2029 DWORD flags = stateblock->textureState[i][WINED3DTSS_TEXTURETRANSFORMFLAGS]; 2030 DWORD tex_transform = flags & ~WINED3DTTFF_PROJECTED; 2031 if (flags & WINED3DTTFF_PROJECTED) 2032 { 2033 tex_transform |= WINED3D_PSARGS_PROJECTED; 2034 } 2035 args->tex_transform |= tex_transform << (i*WINED3D_PSARGS_TEXTRANSFORM_SHIFT); 2036 } 2037 } 2038 2024 2039 for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) 2025 2040 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r35825 r37550 711 711 struct wined3d_context; 712 712 713 #define WINED3D_PSARGS_PROJECTED (1<<3) 714 #define WINED3D_PSARGS_TEXTRANSFORM_SHIFT 4 715 #define WINED3D_PSARGS_TEXTRANSFORM_MASK 0xF 716 713 717 /* Stateblock dependent parameters which have to be hardcoded 714 718 * into the shader code … … 719 723 enum fogmode fog; 720 724 /* Projected textures(ps 1.0-1.3) */ 725 WORD tex_transform; 721 726 /* Texture types(2D, Cube, 3D) in ps 1.x */ 722 BOOLsrgb_correction;727 WORD srgb_correction; 723 728 WORD np2_fixup; 724 729 /* Bitmap for NP2 texcoord fixups (16 samplers max currently).
Note:
See TracChangeset
for help on using the changeset viewer.