Changeset 23571 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Timestamp:
- Oct 6, 2009 6:07:06 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/arb_program_shader.c
r22496 r23571 101 101 /* ARB_program_shader private data */ 102 102 103 struct loop_control104 {105 unsigned int count;106 unsigned int start;107 int step;108 };109 110 103 struct control_frame 111 104 { … … 125 118 unsigned int ifc_no; 126 119 }; 127 struct loop_controlloop_control;120 struct wined3d_shader_loop_control loop_control; 128 121 BOOL had_else; 129 122 }; … … 142 135 { 143 136 struct ps_compile_args super; 144 DWORD bools; /* WORD is enough, use DWORD for alignment */ 137 WORD bools; 138 WORD clip; /* only a boolean, use a WORD for alignment */ 145 139 unsigned char loop_ctrl[MAX_CONST_I][3]; 146 140 }; … … 282 276 ********************************************************/ 283 277 284 /** 285 * Loads floating point constants into the currently set ARB_vertex/fragment_program. 278 /* Loads floating point constants into the currently set ARB_vertex/fragment_program. 286 279 * When constant_list == NULL, it will load all the constants. 287 * 280 * 288 281 * @target_type should be either GL_VERTEX_PROGRAM_ARB (for vertex shaders) 289 282 * or GL_FRAGMENT_PROGRAM_ARB (for pixel shaders) … … 294 287 { 295 288 local_constant* lconst; 296 DWORD i = 0, j;289 DWORD i, j; 297 290 unsigned int ret; 298 291 299 if (TRACE_ON(d3d_shader)) { 292 if (TRACE_ON(d3d_constants)) 293 { 300 294 for(i = 0; i < max_constants; i++) { 301 295 if(!dirty_consts[i]) continue; … … 305 299 } 306 300 } 301 302 i = 0; 303 307 304 /* In 1.X pixel shaders constants are implicitly clamped in the range [-1;1] */ 308 305 if (target_type == GL_FRAGMENT_PROGRAM_ARB && This->baseShader.reg_maps.shader_version.major == 1) … … 546 543 /** 547 544 * Loads the app-supplied constants into the currently set ARB_[vertex/fragment]_programs. 548 * 549 * We only support float constants in ARB at the moment, so don't 545 * 546 * We only support float constants in ARB at the moment, so don't 550 547 * worry about the Integers or Booleans 551 548 */ … … 632 629 unsigned max_constantsF; 633 630 const local_constant *lconst; 631 DWORD map; 634 632 635 633 /* In pixel shaders, all private constants are program local, we don't need anything … … 675 673 } 676 674 677 for(i = 0; i < This->baseShader.limits.temporary; i++) { 678 if (reg_maps->temporary[i]) 679 shader_addline(buffer, "TEMP R%u;\n", i); 680 } 681 682 for (i = 0; i < This->baseShader.limits.address; i++) { 683 if (reg_maps->address[i]) 684 shader_addline(buffer, "ADDRESS A%d;\n", i); 685 } 686 687 if(pshader && reg_maps->shader_version.major == 1 && reg_maps->shader_version.minor <= 3) { 688 for(i = 0; i < This->baseShader.limits.texcoord; i++) { 689 if (reg_maps->texcoord[i] && pshader) 690 shader_addline(buffer,"TEMP T%u;\n", i); 675 for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i) 676 { 677 if (map & 1) shader_addline(buffer, "TEMP R%u;\n", i); 678 } 679 680 for (i = 0, map = reg_maps->address; map; map >>= 1, ++i) 681 { 682 if (map & 1) shader_addline(buffer, "ADDRESS A%u;\n", i); 683 } 684 685 if (pshader && reg_maps->shader_version.major == 1 && reg_maps->shader_version.minor <= 3) 686 { 687 for (i = 0, map = reg_maps->texcoord; map; map >>= 1, ++i) 688 { 689 if (map & 1) shader_addline(buffer, "TEMP T%u;\n", i); 691 690 } 692 691 } … … 1262 1261 if (flags & TEX_DERIV) 1263 1262 { 1264 if(flags & TEX_PROJ) FIXME("Projected texture sampling with custom derivat es\n");1265 if(flags & TEX_BIAS) FIXME("Biased texture sampling with custom derivat es\n");1263 if(flags & TEX_PROJ) FIXME("Projected texture sampling with custom derivatives\n"); 1264 if(flags & TEX_BIAS) FIXME("Biased texture sampling with custom derivatives\n"); 1266 1265 shader_addline(buffer, "TXD%s %s, %s, %s, %s, texture[%u], %s;\n", mod, dst_str, coord_reg, 1267 1266 dsx, dsy,sampler_idx, tex_type); … … 2038 2037 char dst_str[50]; 2039 2038 char src0_name[50]; 2040 char dst_reg[ 8];2039 char dst_reg[50]; 2041 2040 BOOL is_color; 2042 2041 … … 2081 2080 char src0_name[50]; 2082 2081 char src1_name[50]; 2083 char dst_reg[ 8];2082 char dst_reg[50]; 2084 2083 BOOL is_color; 2085 2084 … … 3010 3009 { 3011 3010 GLuint program_id = 0; 3011 GLint pos; 3012 3012 3013 const char *blt_vprogram = 3013 3014 "!!ARBvp1.0\n" … … 3020 3021 GL_EXTCALL(glGenProgramsARB(1, &program_id)); 3021 3022 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, program_id)); 3022 GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(blt_vprogram), blt_vprogram)); 3023 3024 if (glGetError() == GL_INVALID_OPERATION) { 3025 GLint pos; 3026 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 3023 GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 3024 strlen(blt_vprogram), blt_vprogram)); 3025 checkGLcall("glProgramStringARB()"); 3026 3027 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 3028 if (pos != -1) 3029 { 3027 3030 FIXME("Vertex program error at position %d: %s\n", pos, 3028 3031 debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 3029 3032 } 3033 else 3034 { 3035 GLint native; 3036 3037 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 3038 checkGLcall("glGetProgramivARB()"); 3039 if (!native) WARN("Program exceeds native resource limits.\n"); 3040 } 3030 3041 3031 3042 return program_id; … … 3036 3047 { 3037 3048 GLuint program_id = 0; 3049 GLint pos; 3050 3038 3051 static const char * const blt_fprograms[tex_type_count] = 3039 3052 { … … 3070 3083 GL_EXTCALL(glGenProgramsARB(1, &program_id)); 3071 3084 GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, program_id)); 3072 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(blt_fprograms[tex_type]), blt_fprograms[tex_type])); 3073 3074 if (glGetError() == GL_INVALID_OPERATION) { 3075 GLint pos; 3076 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 3085 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 3086 strlen(blt_fprograms[tex_type]), blt_fprograms[tex_type])); 3087 checkGLcall("glProgramStringARB()"); 3088 3089 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 3090 if (pos != -1) 3091 { 3077 3092 FIXME("Fragment program error at position %d: %s\n", pos, 3078 3093 debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 3094 } 3095 else 3096 { 3097 GLint native; 3098 3099 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 3100 checkGLcall("glGetProgramivARB()"); 3101 if (!native) WARN("Program exceeds native resource limits.\n"); 3079 3102 } 3080 3103 … … 3229 3252 BOOL dcl_tmp = args->super.srgb_correction, dcl_td = FALSE; 3230 3253 BOOL want_nv_prog = FALSE; 3231 struct arb_pshader_private *shader_priv = This->backend_priv; 3254 struct arb_pshader_private *shader_priv = This->baseShader.backend_data; 3255 GLint errPos; 3256 DWORD map; 3232 3257 3233 3258 char srgbtmp[4][4]; 3234 3259 unsigned int i, found = 0; 3235 3260 3236 for(i = 0; i < This->baseShader.limits.temporary; i++) { 3237 3238 /* Don't overwrite the color source */ 3239 if(This->color0_mov && i == This->color0_reg) continue; 3240 else if(reg_maps->shader_version.major < 2 && i == 0) continue; 3241 3242 if(reg_maps->temporary[i]) { 3243 sprintf(srgbtmp[found], "R%u", i); 3244 found++; 3245 if(found == 4) break; 3246 } 3261 for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i) 3262 { 3263 if (!(map & 1) 3264 || (This->color0_mov && i == This->color0_reg) 3265 || (reg_maps->shader_version.major < 2 && i == 0)) 3266 continue; 3267 3268 sprintf(srgbtmp[found], "R%u", i); 3269 ++found; 3270 if (found == 4) break; 3247 3271 } 3248 3272 … … 3375 3399 lconst_map, NULL, &priv_ctx); 3376 3400 3377 for(i = 0; i < (sizeof(reg_maps->bumpmat) / sizeof(reg_maps->bumpmat[0])); i++) { 3378 if(!reg_maps->bumpmat[i]) continue; 3401 for (i = 0, map = reg_maps->bumpmat; map; map >>= 1, ++i) 3402 { 3403 if (!(map & 1)) continue; 3379 3404 3380 3405 cur = compiled->numbumpenvmatconsts; … … 3398 3423 compiled->numbumpenvmatconsts = cur + 1; 3399 3424 3400 if (!reg_maps->luminanceparams[i]) continue;3425 if (!(reg_maps->luminanceparams & (1 << i))) continue; 3401 3426 3402 3427 compiled->luminanceconst[cur].const_num = next_local++; … … 3486 3511 } 3487 3512 3488 if (shader_priv->clipplane_emulation)3489 { 3490 shader_addline(buffer, "KIL fragment.texcoord[%u];\n", shader_priv->clipplane_emulation - 1);3513 if (shader_priv->clipplane_emulation != ~0U && args->clip) 3514 { 3515 shader_addline(buffer, "KIL fragment.texcoord[%u];\n", shader_priv->clipplane_emulation); 3491 3516 } 3492 3517 … … 3512 3537 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 3513 3538 buffer->bsize, buffer->buffer)); 3514 3515 if (glGetError() == GL_INVALID_OPERATION) { 3516 GLint errPos; 3517 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); 3539 checkGLcall("glProgramStringARB()"); 3540 3541 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); 3542 if (errPos != -1) 3543 { 3518 3544 FIXME("HW PixelShader Error at position %d: %s\n", 3519 3545 errPos, debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 3520 3546 retval = 0; 3547 } 3548 else 3549 { 3550 GLint native; 3551 3552 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 3553 checkGLcall("glGetProgramivARB()"); 3554 if (!native) WARN("Program exceeds native resource limits.\n"); 3521 3555 } 3522 3556 … … 3796 3830 struct shader_arb_ctx_priv priv_ctx; 3797 3831 unsigned int i; 3832 GLint errPos; 3798 3833 3799 3834 memset(&priv_ctx, 0, sizeof(priv_ctx)); … … 3905 3940 GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 3906 3941 buffer->bsize, buffer->buffer)); 3907 3908 if (glGetError() == GL_INVALID_OPERATION) { 3909 GLint errPos; 3910 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); 3942 checkGLcall("glProgramStringARB()"); 3943 3944 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); 3945 if (errPos != -1) 3946 { 3911 3947 FIXME("HW VertexShader Error at position %d: %s\n", 3912 3948 errPos, debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 3913 3949 ret = -1; 3914 } else { 3950 } 3951 else 3952 { 3953 GLint native; 3954 3955 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 3956 checkGLcall("glGetProgramivARB()"); 3957 if (!native) WARN("Program exceeds native resource limits.\n"); 3958 3915 3959 /* Load immediate constants */ 3916 3960 if(lconst_map) { … … 3924 3968 3925 3969 return ret; 3926 }3927 3928 static void find_clip_texcoord(IWineD3DPixelShaderImpl *ps)3929 {3930 struct arb_pshader_private *shader_priv = ps->backend_priv;3931 int i;3932 const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)ps->baseShader.device)->adapter->gl_info;3933 3934 /* See if we can use fragment.texcoord[7] for clipplane emulation3935 *3936 * Don't do this if it is not supported, or fragment.texcoord[7] is used3937 */3938 if(ps->baseShader.reg_maps.shader_version.major < 3)3939 {3940 for(i = GL_LIMITS(texture_stages); i > 0; i--)3941 {3942 if(!ps->baseShader.reg_maps.texcoord[i - 1])3943 {3944 shader_priv->clipplane_emulation = i;3945 return;3946 }3947 }3948 WARN("Did not find a free clip reg(2.0)\n");3949 }3950 else3951 {3952 for(i = GL_LIMITS(texture_stages); i > 0; i--)3953 {3954 if(!(ps->baseShader.reg_maps.input_registers & (1 << (i - 1))))3955 {3956 shader_priv->clipplane_emulation = i;3957 return;3958 }3959 }3960 WARN("Did not find a free clip reg(3.0)\n");3961 }3962 3970 } 3963 3971 … … 3972 3980 GLuint ret; 3973 3981 3974 if(!shader->backend_priv) { 3982 if (!shader->baseShader.backend_data) 3983 { 3975 3984 IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) shader->baseShader.device; 3985 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 3976 3986 struct shader_arb_priv *priv = device->shader_priv; 3977 3987 3978 shader->ba ckend_priv= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));3979 shader_data = shader->ba ckend_priv;3988 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 3989 shader_data = shader->baseShader.backend_data; 3980 3990 shader_data->clamp_consts = shader->baseShader.reg_maps.shader_version.major == 1; 3981 3991 … … 3986 3996 TRACE("Shader got assigned input signature index %u\n", shader_data->input_signature_idx); 3987 3997 3988 if(!device->vs_clipping) find_clip_texcoord(shader); 3989 } 3990 shader_data = shader->backend_priv; 3998 if (!device->vs_clipping) 3999 shader_data->clipplane_emulation = shader_find_free_input_register(&shader->baseShader.reg_maps, 4000 GL_LIMITS(texture_stages) - 1); 4001 else 4002 shader_data->clipplane_emulation = ~0U; 4003 } 4004 shader_data = shader->baseShader.backend_data; 3991 4005 3992 4006 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2), … … 4062 4076 const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; 4063 4077 4064 if(!shader->backend_priv) { 4065 shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 4066 } 4067 shader_data = shader->backend_priv; 4078 if (!shader->baseShader.backend_data) 4079 { 4080 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 4081 } 4082 shader_data = shader->baseShader.backend_data; 4068 4083 4069 4084 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2), … … 4130 4145 } 4131 4146 4147 /* Only enable the clip plane emulation KIL if at least one clipplane is enabled. The KIL instruction 4148 * is quite expensive because it forces the driver to disable early Z discards. It is cheaper to 4149 * duplicate the shader than have a no-op KIL instruction in every shader 4150 */ 4151 if((!((IWineD3DDeviceImpl *) shader->baseShader.device)->vs_clipping) && use_vs(stateblock) && 4152 stateblock->renderState[WINED3DRS_CLIPPING] && stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]) 4153 { 4154 args->clip = 1; 4155 } 4156 else 4157 { 4158 args->clip = 0; 4159 } 4160 4132 4161 /* Skip if unused or local, or supported natively */ 4133 4162 int_skip = ~shader->baseShader.reg_maps.integer_constants | shader->baseShader.reg_maps.local_int_consts; … … 4168 4197 { 4169 4198 IWineD3DPixelShaderImpl *ps = (IWineD3DPixelShaderImpl *) stateblock->pixelShader; 4170 struct arb_pshader_private *shader_priv = ps->ba ckend_priv;4199 struct arb_pshader_private *shader_priv = ps->baseShader.backend_data; 4171 4200 args->ps_signature = shader_priv->input_signature_idx; 4172 4201 4173 args->boolclip.clip_control[0] = shader_priv->clipplane_emulation ;4202 args->boolclip.clip_control[0] = shader_priv->clipplane_emulation + 1; 4174 4203 } 4175 4204 else … … 4264 4293 * a 1.x and newer shader, reload the first 8 constants 4265 4294 */ 4266 if(priv->last_ps_const_clamped != ((struct arb_pshader_private *) ps->backend_priv)->clamp_consts)4267 { 4268 priv->last_ps_const_clamped = ((struct arb_pshader_private *) ps->backend_priv)->clamp_consts;4295 if(priv->last_ps_const_clamped != ((struct arb_pshader_private *)ps->baseShader.backend_data)->clamp_consts) 4296 { 4297 priv->last_ps_const_clamped = ((struct arb_pshader_private *)ps->baseShader.backend_data)->clamp_consts; 4269 4298 This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, 8); 4270 4299 for(i = 0; i < 8; i++) … … 4382 4411 { 4383 4412 IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *) iface; 4384 struct arb_pshader_private *shader_data = This->ba ckend_priv;4413 struct arb_pshader_private *shader_data = This->baseShader.backend_data; 4385 4414 UINT i; 4386 4415 … … 4397 4426 HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders); 4398 4427 HeapFree(GetProcessHeap(), 0, shader_data); 4399 This->ba ckend_priv= NULL;4428 This->baseShader.backend_data = NULL; 4400 4429 } else { 4401 4430 IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *) iface; 4402 struct arb_vshader_private *shader_data = This->ba ckend_priv;4431 struct arb_vshader_private *shader_data = This->baseShader.backend_data; 4403 4432 UINT i; 4404 4433 … … 4415 4444 HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders); 4416 4445 HeapFree(GetProcessHeap(), 0, shader_data); 4417 This->ba ckend_priv= NULL;4446 This->baseShader.backend_data = NULL; 4418 4447 } 4419 4448 } … … 4425 4454 } 4426 4455 4427 st ruct wine_rb_functions sig_tree_functions =4456 static const struct wine_rb_functions sig_tree_functions = 4428 4457 { 4429 4458 wined3d_rb_alloc, … … 4696 4725 4697 4726 static void get_loop_control_const(const struct wined3d_shader_instruction *ins, 4698 IWineD3DBaseShaderImpl *This, UINT idx, struct loop_control *loop_control)4727 IWineD3DBaseShaderImpl *This, UINT idx, struct wined3d_shader_loop_control *loop_control) 4699 4728 { 4700 4729 struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; … … 5239 5268 if (use_ps(stateblock)) 5240 5269 { 5241 if(stage != 0 && 5242 ((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.bumpmat[stage]) { 5270 if (stage != 0 5271 && (((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.reg_maps.bumpmat & (1 << stage))) 5272 { 5243 5273 /* The pixel shader has to know the bump env matrix. Do a constants update if it isn't scheduled 5244 5274 * anyway … … 5275 5305 if (use_ps(stateblock)) 5276 5306 { 5277 if(stage != 0 && 5278 ((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.luminanceparams[stage]) { 5307 if (stage != 0 5308 && (((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.reg_maps.luminanceparams & (1 << stage))) 5309 { 5279 5310 /* The pixel shader has to know the luminance offset. Do a constants update if it 5280 5311 * isn't scheduled anyway … … 5530 5561 BOOL op_equal; 5531 5562 const char *final_combiner_src = "ret"; 5563 GLint pos; 5532 5564 5533 5565 /* Find out which textures are read */ … … 5763 5795 GL_EXTCALL(glGenProgramsARB(1, &ret)); 5764 5796 GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ret)); 5765 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(buffer.buffer), buffer.buffer)); 5766 5767 if (glGetError() == GL_INVALID_OPERATION) { 5768 GLint pos; 5769 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 5797 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 5798 strlen(buffer.buffer), buffer.buffer)); 5799 checkGLcall("glProgramStringARB()"); 5800 5801 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 5802 if (pos != -1) 5803 { 5770 5804 FIXME("Fragment program error at position %d: %s\n", pos, 5771 5805 debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 5772 5806 } 5807 else 5808 { 5809 GLint native; 5810 5811 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 5812 checkGLcall("glGetProgramivARB()"); 5813 if (!native) WARN("Program exceeds native resource limits.\n"); 5814 } 5815 5773 5816 shader_buffer_free(&buffer); 5774 5817 return ret; … … 6349 6392 char luminance_component; 6350 6393 struct arbfp_blit_priv *priv = device->blit_priv; 6394 GLint pos; 6351 6395 6352 6396 /* Shader header */ … … 6451 6495 6452 6496 ENTER_GL(); 6453 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(buffer.buffer), buffer.buffer)); 6454 6455 if (glGetError() == GL_INVALID_OPERATION) { 6456 GLint pos; 6457 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 6497 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, 6498 strlen(buffer.buffer), buffer.buffer)); 6499 checkGLcall("glProgramStringARB()"); 6500 6501 glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); 6502 if (pos != -1) 6503 { 6458 6504 FIXME("Fragment program error at position %d: %s\n", pos, 6459 6505 debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); 6460 6506 } 6507 else 6508 { 6509 GLint native; 6510 6511 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native)); 6512 checkGLcall("glGetProgramivARB()"); 6513 if (!native) WARN("Program exceeds native resource limits.\n"); 6514 } 6515 6461 6516 shader_buffer_free(&buffer); 6462 6517 LEAVE_GL(); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/baseshader.c
r22496 r23571 217 217 } 218 218 219 void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDevice *device) 219 void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDeviceImpl *device, 220 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 220 221 { 221 222 shader->ref = 1; 222 shader->device = device; 223 shader->device = (IWineD3DDevice *)device; 224 shader->parent = parent; 225 shader->parent_ops = parent_ops; 223 226 list_init(&shader->linked_programs); 227 list_add_head(&device->shaders, &shader->shader_list_entry); 224 228 } 225 229 … … 268 272 { 269 273 case WINED3DSPR_TEXTURE: /* WINED3DSPR_ADDR */ 270 if (shader_type == WINED3D_SHADER_TYPE_PIXEL) reg_maps->texcoord [reg->idx] = 1;271 else reg_maps->address [reg->idx] = 1;274 if (shader_type == WINED3D_SHADER_TYPE_PIXEL) reg_maps->texcoord |= 1 << reg->idx; 275 else reg_maps->address |= 1 << reg->idx; 272 276 break; 273 277 274 278 case WINED3DSPR_TEMP: 275 reg_maps->temporary [reg->idx] = 1;279 reg_maps->temporary |= 1 << reg->idx; 276 280 break; 277 281 … … 610 614 611 615 fe->shader_read_src_param(fe_data, &pToken, &src, &rel_addr); 612 reg_maps->labels [src.reg.idx] = 1;616 reg_maps->labels |= 1 << src.reg.idx; 613 617 } 614 618 /* Set texture, address, temporary registers */ … … 697 701 || ins.handler_idx == WINED3DSIH_TEXBEML) 698 702 { 699 reg_maps->bumpmat [sampler_code] = TRUE;703 reg_maps->bumpmat |= 1 << dst_param.reg.idx; 700 704 if (ins.handler_idx == WINED3DSIH_TEXBEML) 701 705 { 702 reg_maps->luminanceparams [sampler_code] = TRUE;706 reg_maps->luminanceparams |= 1 << dst_param.reg.idx; 703 707 } 704 708 } … … 706 710 else if (ins.handler_idx == WINED3DSIH_BEM) 707 711 { 708 reg_maps->bumpmat [dst_param.reg.idx] = TRUE;712 reg_maps->bumpmat |= 1 << dst_param.reg.idx; 709 713 } 710 714 } … … 778 782 779 783 return WINED3D_OK; 784 } 785 786 unsigned int shader_find_free_input_register(const struct shader_reg_maps *reg_maps, unsigned int max) 787 { 788 DWORD map = 1 << max; 789 map |= map - 1; 790 map &= reg_maps->shader_version.major < 3 ? ~reg_maps->texcoord : ~reg_maps->input_registers; 791 792 return wined3d_log2i(map); 780 793 } 781 794 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/basetexture.c
r22496 r23571 6 6 * Copyright 2005 Oliver Stieber 7 7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 39 40 HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DRESOURCETYPE resource_type, 40 41 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc, 41 WINED3DPOOL pool, IUnknown *parent )42 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 42 43 { 43 44 HRESULT hr; 44 45 45 hr = resource_init((IWineD3DResource *)texture, resource_type, device, size, usage, format_desc, pool, parent); 46 hr = resource_init((IWineD3DResource *)texture, resource_type, device, 47 size, usage, format_desc, pool, parent, parent_ops); 46 48 if (FAILED(hr)) 47 49 { … … 53 55 texture->baseTexture.filterType = (usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3DTEXF_LINEAR : WINED3DTEXF_NONE; 54 56 texture->baseTexture.LOD = 0; 55 texture->baseTexture. dirty = TRUE;56 texture->baseTexture. srgbDirty = TRUE;57 texture->baseTexture.texture_rgb.dirty = TRUE; 58 texture->baseTexture.texture_srgb.dirty = TRUE; 57 59 texture->baseTexture.is_srgb = FALSE; 58 60 texture->baseTexture.pow2Matrix_identity = TRUE; … … 78 80 } 79 81 82 /* A GL context is provided by the caller */ 83 static void gltexture_delete(struct gl_texture *tex) 84 { 85 ENTER_GL(); 86 glDeleteTextures(1, &tex->name); 87 LEAVE_GL(); 88 tex->name = 0; 89 } 90 80 91 void basetexture_unload(IWineD3DBaseTexture *iface) 81 92 { … … 83 94 IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; 84 95 85 if(This->baseTexture.textureName) { 96 if(This->baseTexture.texture_rgb.name || 97 This->baseTexture.texture_srgb.name) { 86 98 ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD); 87 ENTER_GL(); 88 glDeleteTextures(1, &This->baseTexture.textureName); 89 This->baseTexture.textureName = 0; 90 LEAVE_GL(); 91 } 92 93 if(This->baseTexture.srgbTextureName) { 94 ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD); 95 ENTER_GL(); 96 glDeleteTextures(1, &This->baseTexture.srgbTextureName); 97 This->baseTexture.srgbTextureName = 0; 98 LEAVE_GL(); 99 } 100 This->baseTexture.dirty = TRUE; 101 This->baseTexture.srgbDirty = TRUE; 102 } 103 104 /* There is no OpenGL equivalent of setLOD, getLOD. All they do anyway is prioritize texture loading 105 * so just pretend that they work unless something really needs a failure. */ 99 } 100 101 if(This->baseTexture.texture_rgb.name) { 102 gltexture_delete(&This->baseTexture.texture_rgb); 103 } 104 if(This->baseTexture.texture_srgb.name) { 105 gltexture_delete(&This->baseTexture.texture_srgb); 106 } 107 This->baseTexture.texture_rgb.dirty = TRUE; 108 This->baseTexture.texture_srgb.dirty = TRUE; 109 } 110 106 111 DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) 107 112 { 108 113 IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; 109 114 DWORD old = This->baseTexture.LOD; 115 116 /* The d3d9:texture test shows that SetLOD is ignored on non-managed 117 * textures. The call always returns 0, and GetLOD always returns 0 118 */ 110 119 if (This->resource.pool != WINED3DPOOL_MANAGED) { 111 return WINED3DERR_INVALIDCALL; 120 TRACE("Ignoring SetLOD on %s texture, returning 0\n", debug_d3dpool(This->resource.pool)); 121 return 0; 112 122 } 113 123 114 124 if(LODNew >= This->baseTexture.levels) 115 125 LODNew = This->baseTexture.levels - 1; 116 This->baseTexture.LOD = LODNew; 117 118 TRACE("(%p) : set bogus LOD to %d\n", This, This->baseTexture.LOD); 119 120 return This->baseTexture.LOD; 126 127 if(This->baseTexture.LOD != LODNew) { 128 This->baseTexture.LOD = LODNew; 129 130 This->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; 131 This->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; 132 if(This->baseTexture.bindCount) { 133 IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(This->baseTexture.sampler)); 134 } 135 } 136 137 TRACE("(%p) : set LOD to %d\n", This, This->baseTexture.LOD); 138 139 return old; 121 140 } 122 141 … … 124 143 { 125 144 IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; 126 127 if (This->resource.pool != WINED3DPOOL_MANAGED) {128 return WINED3DERR_INVALIDCALL;129 }130 145 131 146 TRACE("(%p) : returning %d\n", This, This->baseTexture.LOD); … … 158 173 ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD); 159 174 ENTER_GL(); 160 glBindTexture(textureDimensions, This->baseTexture.texture Name);175 glBindTexture(textureDimensions, This->baseTexture.texture_rgb.name); 161 176 checkGLcall("glBindTexture"); 162 177 switch(FilterType) { … … 205 220 BOOL old; 206 221 IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; 207 old = This->baseTexture. dirty || This->baseTexture.srgbDirty;208 This->baseTexture. dirty = dirty;209 This->baseTexture. srgbDirty = dirty;222 old = This->baseTexture.texture_rgb.dirty || This->baseTexture.texture_srgb.dirty; 223 This->baseTexture.texture_rgb.dirty = dirty; 224 This->baseTexture.texture_srgb.dirty = dirty; 210 225 return old; 211 226 } … … 214 229 { 215 230 IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; 216 return This->baseTexture. dirty || This->baseTexture.srgbDirty;231 return This->baseTexture.texture_rgb.dirty || This->baseTexture.texture_srgb.dirty; 217 232 } 218 233 … … 224 239 UINT textureDimensions; 225 240 BOOL isNewTexture = FALSE; 226 GLuint *texture; 227 DWORD *states; 241 struct gl_texture *gl_tex; 228 242 TRACE("(%p) : About to bind texture\n", This); 229 243 230 244 This->baseTexture.is_srgb = srgb; /* SRGB mode cache for PreLoad calls outside drawprim */ 231 245 if(srgb) { 232 texture = &This->baseTexture.srgbTextureName; 233 states = This->baseTexture.srgbstates; 246 gl_tex = &This->baseTexture.texture_srgb; 234 247 } else { 235 texture = &This->baseTexture.textureName; 236 states = This->baseTexture.states; 248 gl_tex = &This->baseTexture.texture_rgb; 237 249 } 238 250 … … 240 252 ENTER_GL(); 241 253 /* Generate a texture name if we don't already have one */ 242 if ( *texture == 0) {254 if (gl_tex->name == 0) { 243 255 *set_surface_desc = TRUE; 244 glGenTextures(1, texture);256 glGenTextures(1, &gl_tex->name); 245 257 checkGLcall("glGenTextures"); 246 TRACE("Generated texture %d\n", *texture);258 TRACE("Generated texture %d\n", gl_tex->name); 247 259 if (This->resource.pool == WINED3DPOOL_DEFAULT) { 248 260 /* Tell opengl to try and keep this texture in video ram (well mostly) */ 249 261 GLclampf tmp; 250 262 tmp = 0.9f; 251 glPrioritizeTextures(1, texture, &tmp);263 glPrioritizeTextures(1, &gl_tex->name, &tmp); 252 264 253 265 } 254 266 /* Initialise the state of the texture object 255 267 to the openGL defaults, not the directx defaults */ 256 states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_WRAP;257 states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_WRAP;258 states[WINED3DTEXSTA_ADDRESSW] = WINED3DTADDRESS_WRAP;259 states[WINED3DTEXSTA_BORDERCOLOR] = 0;260 states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR;261 states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */262 states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */263 states[WINED3DTEXSTA_MAXMIPLEVEL] = 0;264 states[WINED3DTEXSTA_MAXANISOTROPY] = 1;265 states[WINED3DTEXSTA_SRGBTEXTURE] = 0;266 states[WINED3DTEXSTA_ELEMENTINDEX] = 0;267 states[WINED3DTEXSTA_DMAPOFFSET] = 0;268 states[WINED3DTEXSTA_TSSADDRESSW] = WINED3DTADDRESS_WRAP;268 gl_tex->states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_WRAP; 269 gl_tex->states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_WRAP; 270 gl_tex->states[WINED3DTEXSTA_ADDRESSW] = WINED3DTADDRESS_WRAP; 271 gl_tex->states[WINED3DTEXSTA_BORDERCOLOR] = 0; 272 gl_tex->states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR; 273 gl_tex->states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */ 274 gl_tex->states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */ 275 gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = 0; 276 gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = 1; 277 gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE] = 0; 278 gl_tex->states[WINED3DTEXSTA_ELEMENTINDEX] = 0; 279 gl_tex->states[WINED3DTEXSTA_DMAPOFFSET] = 0; 280 gl_tex->states[WINED3DTEXSTA_TSSADDRESSW] = WINED3DTADDRESS_WRAP; 269 281 IWineD3DBaseTexture_SetDirty(iface, TRUE); 270 282 isNewTexture = TRUE; … … 274 286 * in all, and the run-time path free from additional checks 275 287 */ 276 glBindTexture(textureDimensions, *texture);288 glBindTexture(textureDimensions, gl_tex->name); 277 289 checkGLcall("glBindTexture"); 278 290 glTexParameteri(textureDimensions, GL_GENERATE_MIPMAP_SGIS, GL_TRUE); … … 284 296 285 297 /* Bind the texture */ 286 if ( *texture != 0) {287 glBindTexture(textureDimensions, *texture);298 if (gl_tex->name != 0) { 299 glBindTexture(textureDimensions, gl_tex->name); 288 300 checkGLcall("glBindTexture"); 289 301 if (isNewTexture) { … … 348 360 { 349 361 IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; 350 DWORD state , *states;362 DWORD state; 351 363 GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); 352 364 BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface); 353 365 DWORD aniso; 366 struct gl_texture *gl_tex; 354 367 355 368 TRACE("iface %p, textureStates %p, samplerStates %p\n", iface, textureStates, samplerStates); 356 369 357 370 if(This->baseTexture.is_srgb) { 358 states = This->baseTexture.srgbstates;371 gl_tex = &This->baseTexture.texture_srgb; 359 372 } else { 360 states = This->baseTexture.states;373 gl_tex = &This->baseTexture.texture_rgb; 361 374 } 362 375 363 376 /* This function relies on the correct texture being bound and loaded. */ 364 377 365 if(samplerStates[WINED3DSAMP_ADDRESSU] != states[WINED3DTEXSTA_ADDRESSU]) {378 if(samplerStates[WINED3DSAMP_ADDRESSU] != gl_tex->states[WINED3DTEXSTA_ADDRESSU]) { 366 379 state = samplerStates[WINED3DSAMP_ADDRESSU]; 367 380 apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_S, cond_np2); 368 states[WINED3DTEXSTA_ADDRESSU] = state;369 } 370 371 if(samplerStates[WINED3DSAMP_ADDRESSV] != states[WINED3DTEXSTA_ADDRESSV]) {381 gl_tex->states[WINED3DTEXSTA_ADDRESSU] = state; 382 } 383 384 if(samplerStates[WINED3DSAMP_ADDRESSV] != gl_tex->states[WINED3DTEXSTA_ADDRESSV]) { 372 385 state = samplerStates[WINED3DSAMP_ADDRESSV]; 373 386 apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_T, cond_np2); 374 states[WINED3DTEXSTA_ADDRESSV] = state;375 } 376 377 if(samplerStates[WINED3DSAMP_ADDRESSW] != states[WINED3DTEXSTA_ADDRESSW]) {387 gl_tex->states[WINED3DTEXSTA_ADDRESSV] = state; 388 } 389 390 if(samplerStates[WINED3DSAMP_ADDRESSW] != gl_tex->states[WINED3DTEXSTA_ADDRESSW]) { 378 391 state = samplerStates[WINED3DSAMP_ADDRESSW]; 379 392 apply_wrap(textureDimensions, state, GL_TEXTURE_WRAP_R, cond_np2); 380 states[WINED3DTEXSTA_ADDRESSW] = state;381 } 382 383 if(samplerStates[WINED3DSAMP_BORDERCOLOR] != states[WINED3DTEXSTA_BORDERCOLOR]) {393 gl_tex->states[WINED3DTEXSTA_ADDRESSW] = state; 394 } 395 396 if(samplerStates[WINED3DSAMP_BORDERCOLOR] != gl_tex->states[WINED3DTEXSTA_BORDERCOLOR]) { 384 397 float col[4]; 385 398 … … 389 402 glTexParameterfv(textureDimensions, GL_TEXTURE_BORDER_COLOR, &col[0]); 390 403 checkGLcall("glTexParameteri(..., GL_TEXTURE_BORDER_COLOR, ...)"); 391 states[WINED3DTEXSTA_BORDERCOLOR] = state;392 } 393 394 if(samplerStates[WINED3DSAMP_MAGFILTER] != states[WINED3DTEXSTA_MAGFILTER]) {404 gl_tex->states[WINED3DTEXSTA_BORDERCOLOR] = state; 405 } 406 407 if(samplerStates[WINED3DSAMP_MAGFILTER] != gl_tex->states[WINED3DTEXSTA_MAGFILTER]) { 395 408 GLint glValue; 396 409 state = samplerStates[WINED3DSAMP_MAGFILTER]; … … 404 417 glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue); 405 418 406 states[WINED3DTEXSTA_MAGFILTER] = state;407 } 408 409 if((samplerStates[WINED3DSAMP_MINFILTER] != states[WINED3DTEXSTA_MINFILTER] ||410 samplerStates[WINED3DSAMP_MIPFILTER] != states[WINED3DTEXSTA_MIPFILTER] ||411 samplerStates[WINED3DSAMP_MAXMIPLEVEL] != states[WINED3DTEXSTA_MAXMIPLEVEL])) {419 gl_tex->states[WINED3DTEXSTA_MAGFILTER] = state; 420 } 421 422 if((samplerStates[WINED3DSAMP_MINFILTER] != gl_tex->states[WINED3DTEXSTA_MINFILTER] || 423 samplerStates[WINED3DSAMP_MIPFILTER] != gl_tex->states[WINED3DTEXSTA_MIPFILTER] || 424 samplerStates[WINED3DSAMP_MAXMIPLEVEL] != gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL])) { 412 425 GLint glValue; 413 426 414 states[WINED3DTEXSTA_MIPFILTER] = samplerStates[WINED3DSAMP_MIPFILTER];415 states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER];416 states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL];417 418 if ( states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC419 ||states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)427 gl_tex->states[WINED3DTEXSTA_MIPFILTER] = samplerStates[WINED3DSAMP_MIPFILTER]; 428 gl_tex->states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER]; 429 gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL]; 430 431 if (gl_tex->states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC 432 || gl_tex->states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC) 420 433 { 421 434 422 435 FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %d D3DSAMP_MIPFILTER value %d\n", 423 states[WINED3DTEXSTA_MINFILTER],424 states[WINED3DTEXSTA_MIPFILTER]);436 gl_tex->states[WINED3DTEXSTA_MINFILTER], 437 gl_tex->states[WINED3DTEXSTA_MIPFILTER]); 425 438 } 426 439 glValue = wined3d_gl_min_mip_filter(This->baseTexture.minMipLookup, … … 435 448 436 449 if(!cond_np2) { 437 if( states[WINED3DTEXSTA_MIPFILTER] == WINED3DTEXF_NONE) {438 glValue = 0;439 } else if( states[WINED3DTEXSTA_MAXMIPLEVEL] >= This->baseTexture.levels) {450 if(gl_tex->states[WINED3DTEXSTA_MIPFILTER] == WINED3DTEXF_NONE) { 451 glValue = This->baseTexture.LOD; 452 } else if(gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] >= This->baseTexture.levels) { 440 453 glValue = This->baseTexture.levels - 1; 454 } else if(gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL] < This->baseTexture.LOD) { 455 /* baseTexture.LOD is already clamped in the setter */ 456 glValue = This->baseTexture.LOD; 441 457 } else { 442 glValue = states[WINED3DTEXSTA_MAXMIPLEVEL];458 glValue = gl_tex->states[WINED3DTEXSTA_MAXMIPLEVEL]; 443 459 } 460 /* Note that D3DSAMP_MAXMIPLEVEL specifies the biggest mipmap(default 0), while 461 * GL_TEXTURE_MAX_LEVEL specifies the smallest mimap used(default 1000). 462 * So D3DSAMP_MAXMIPLEVEL is the same as GL_TEXTURE_BASE_LEVEL. 463 */ 444 464 glTexParameteri(textureDimensions, GL_TEXTURE_BASE_LEVEL, glValue); 445 465 } 446 466 } 447 467 448 if (( states[WINED3DSAMP_MAGFILTER] != WINED3DTEXF_ANISOTROPIC449 && states[WINED3DSAMP_MINFILTER] != WINED3DTEXF_ANISOTROPIC450 && states[WINED3DSAMP_MIPFILTER] != WINED3DTEXF_ANISOTROPIC)468 if ((gl_tex->states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_ANISOTROPIC 469 && gl_tex->states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_ANISOTROPIC 470 && gl_tex->states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_ANISOTROPIC) 451 471 || cond_np2) 452 472 { … … 458 478 } 459 479 460 if ( states[WINED3DTEXSTA_MAXANISOTROPY] != aniso)480 if (gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] != aniso) 461 481 { 462 482 if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC)) … … 469 489 WARN("Anisotropic filtering not supported.\n"); 470 490 } 471 states[WINED3DTEXSTA_MAXANISOTROPY] = aniso;472 } 473 } 491 gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = aniso; 492 } 493 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/buffer.c
r22496 r23571 208 208 } 209 209 210 static BOOL buffer_check_attribute(struct wined3d_buffer *This, 211 const struct wined3d_stream_info_element *attrib, const BOOL check_d3dcolor, const BOOL is_ffp_position, 212 const BOOL is_ffp_color, DWORD *stride_this_run, BOOL *float16_used) 213 { 210 static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct wined3d_stream_info *si, 211 UINT attrib_idx, const BOOL check_d3dcolor, const BOOL is_ffp_position, const BOOL is_ffp_color, 212 DWORD *stride_this_run, BOOL *float16_used) 213 { 214 const struct wined3d_stream_info_element *attrib = &si->elements[attrib_idx]; 214 215 BOOL ret = FALSE; 215 216 WINED3DFORMAT format; … … 218 219 * there, on nonexistent attribs the vbo is 0. 219 220 */ 220 if (attrib->buffer_object != This->buffer_object) return FALSE; 221 if (!(si->use_map & (1 << attrib_idx)) 222 || attrib->buffer_object != This->buffer_object) 223 return FALSE; 221 224 222 225 format = attrib->format_desc->format; … … 230 233 *float16_used = TRUE; 231 234 } 232 else if (check_d3dcolor && format == WINED3DFMT_ A8R8G8B8)235 else if (check_d3dcolor && format == WINED3DFMT_B8G8R8A8_UNORM) 233 236 { 234 237 ret = buffer_process_converted_attribute(This, CONV_D3DCOLOR, attrib, stride_this_run); 235 238 236 if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_ A8R8G8B8format\n");239 if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_B8G8R8A8_UNORM format\n"); 237 240 } 238 241 else if (is_ffp_position && format == WINED3DFMT_R32G32B32A32_FLOAT) … … 265 268 WINED3DFORMAT format; 266 269 267 if ( strided->elements[i].buffer_object != This->buffer_object) continue;270 if (!(strided->use_map & (1 << i)) || strided->elements[i].buffer_object != This->buffer_object) continue; 268 271 269 272 format = strided->elements[i].format_desc->format; … … 316 319 { 317 320 IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; 321 const struct wined3d_stream_info *si = &device->strided_streams; 318 322 UINT stride_this_run = 0; 319 323 BOOL float16_used = FALSE; … … 403 407 for (i = 0; i < MAX_ATTRIBS; ++i) 404 408 { 405 ret = buffer_check_attribute(This, &device->strided_streams.elements[i], 406 FALSE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 409 ret = buffer_check_attribute(This, si, i, FALSE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 407 410 } 408 411 … … 413 416 { 414 417 HeapFree(GetProcessHeap(), 0, This->conversion_shift); 415 This->conversion_shift = find_conversion_shift(This, &device->strided_streams, This->stride);418 This->conversion_shift = find_conversion_shift(This, si, This->stride); 416 419 } 417 420 } … … 423 426 */ 424 427 BOOL support_d3dcolor = GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA); 425 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_POSITION],428 ret = buffer_check_attribute(This, si, WINED3D_FFP_POSITION, 426 429 TRUE, TRUE, FALSE, &stride_this_run, &float16_used) || ret; 427 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_NORMAL],430 ret = buffer_check_attribute(This, si, WINED3D_FFP_NORMAL, 428 431 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 429 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_DIFFUSE],432 ret = buffer_check_attribute(This, si, WINED3D_FFP_DIFFUSE, 430 433 !support_d3dcolor, FALSE, TRUE, &stride_this_run, &float16_used) || ret; 431 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_SPECULAR],434 ret = buffer_check_attribute(This, si, WINED3D_FFP_SPECULAR, 432 435 !support_d3dcolor, FALSE, TRUE, &stride_this_run, &float16_used) || ret; 433 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD0],436 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD0, 434 437 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 435 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD1],438 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD1, 436 439 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 437 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD2],440 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD2, 438 441 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 439 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD3],442 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD3, 440 443 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 441 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD4],444 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD4, 442 445 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 443 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD5],446 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD5, 444 447 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 445 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD6],448 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD6, 446 449 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 447 ret = buffer_check_attribute(This, &device->strided_streams.elements[WINED3D_FFP_TEXCOORD7],450 ret = buffer_check_attribute(This, si, WINED3D_FFP_TEXCOORD7, 448 451 TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; 449 452 … … 642 645 buffer_UnLoad(iface); 643 646 resource_cleanup((IWineD3DResource *)iface); 647 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 644 648 HeapFree(GetProcessHeap(), 0, This); 645 649 } … … 1042 1046 } 1043 1047 1044 const struct IWineD3DBufferVtbl wined3d_buffer_vtbl =1048 static const struct IWineD3DBufferVtbl wined3d_buffer_vtbl = 1045 1049 { 1046 1050 /* IUnknown methods */ … … 1065 1069 buffer_GetDesc, 1066 1070 }; 1071 1072 HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, 1073 UINT size, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, GLenum bind_hint, 1074 const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 1075 { 1076 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &device->adapter->gl_info); 1077 HRESULT hr; 1078 1079 if (!size) 1080 { 1081 WARN("Size 0 requested, returning WINED3DERR_INVALIDCALL\n"); 1082 return WINED3DERR_INVALIDCALL; 1083 } 1084 1085 buffer->vtbl = &wined3d_buffer_vtbl; 1086 1087 hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER, 1088 device, size, usage, format_desc, pool, parent, parent_ops); 1089 if (FAILED(hr)) 1090 { 1091 WARN("Failed to initialize resource, hr %#x\n", hr); 1092 return hr; 1093 } 1094 buffer->buffer_type_hint = bind_hint; 1095 1096 TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, 1097 debug_d3dformat(buffer->resource.format_desc->format), buffer->resource.allocatedMemory, buffer); 1098 1099 if (data) 1100 { 1101 BYTE *ptr; 1102 1103 hr = IWineD3DBuffer_Map((IWineD3DBuffer *)buffer, 0, size, &ptr, 0); 1104 if (FAILED(hr)) 1105 { 1106 ERR("Failed to map buffer, hr %#x\n", hr); 1107 buffer_UnLoad((IWineD3DBuffer *)buffer); 1108 resource_cleanup((IWineD3DResource *)buffer); 1109 return hr; 1110 } 1111 1112 memcpy(ptr, data, size); 1113 1114 hr = IWineD3DBuffer_Unmap((IWineD3DBuffer *)buffer); 1115 if (FAILED(hr)) 1116 { 1117 ERR("Failed to unmap buffer, hr %#x\n", hr); 1118 buffer_UnLoad((IWineD3DBuffer *)buffer); 1119 resource_cleanup((IWineD3DResource *)buffer); 1120 return hr; 1121 } 1122 } 1123 1124 return WINED3D_OK; 1125 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c
r22596 r23571 58 58 if (!*fbo) 59 59 { 60 GL_EXTCALL(glGenFramebuffersEXT(1, fbo));61 checkGLcall("glGenFramebuffers EXT()");60 gl_info->fbo_ops.glGenFramebuffers(1, fbo); 61 checkGLcall("glGenFramebuffers()"); 62 62 TRACE("Created FBO %u.\n", *fbo); 63 63 } … … 67 67 switch (target) 68 68 { 69 case GL_READ_FRAMEBUFFER _EXT:69 case GL_READ_FRAMEBUFFER: 70 70 if (context->fbo_read_binding == f) return; 71 71 context->fbo_read_binding = f; 72 72 break; 73 73 74 case GL_DRAW_FRAMEBUFFER _EXT:74 case GL_DRAW_FRAMEBUFFER: 75 75 if (context->fbo_draw_binding == f) return; 76 76 context->fbo_draw_binding = f; 77 77 break; 78 78 79 case GL_FRAMEBUFFER _EXT:79 case GL_FRAMEBUFFER: 80 80 if (context->fbo_read_binding == f 81 81 && context->fbo_draw_binding == f) return; … … 89 89 } 90 90 91 GL_EXTCALL(glBindFramebufferEXT(target, f));91 gl_info->fbo_ops.glBindFramebuffer(target, f); 92 92 checkGLcall("glBindFramebuffer()"); 93 93 } … … 100 100 for (i = 0; i < GL_LIMITS(buffers); ++i) 101 101 { 102 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + i, GL_TEXTURE_2D, 0, 0));102 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, 0, 0); 103 103 checkGLcall("glFramebufferTexture2D()"); 104 104 } 105 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));105 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 106 106 checkGLcall("glFramebufferTexture2D()"); 107 107 108 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));108 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 109 109 checkGLcall("glFramebufferTexture2D()"); 110 110 } … … 115 115 const struct wined3d_gl_info *gl_info = context->gl_info; 116 116 117 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, fbo);117 context_bind_fbo(context, GL_FRAMEBUFFER, fbo); 118 118 context_clean_fbo_attachments(gl_info); 119 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);120 121 GL_EXTCALL(glDeleteFramebuffersEXT(1, fbo));119 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 120 121 gl_info->fbo_ops.glDeleteFramebuffers(1, fbo); 122 122 checkGLcall("glDeleteFramebuffers()"); 123 123 } … … 135 135 if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl))) 136 136 { 137 if (texture_impl->baseTexture. states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT138 || texture_impl->baseTexture. states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE)139 { 140 texture_impl->baseTexture. states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;141 texture_impl->baseTexture. states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;137 if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT 138 || texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE) 139 { 140 texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; 141 texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE; 142 142 update_minfilter = TRUE; 143 143 } 144 144 145 if (texture_impl->baseTexture. states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_POINT)146 { 147 texture_impl->baseTexture. states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;145 if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_POINT) 146 { 147 texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; 148 148 update_magfilter = TRUE; 149 149 } … … 204 204 if (format_flags & WINED3DFMT_FLAG_DEPTH) 205 205 { 206 GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT,207 GL_RENDERBUFFER _EXT, depth_stencil_impl->current_renderbuffer->id));208 checkGLcall("glFramebufferRenderbuffer EXT()");206 gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_DEPTH_ATTACHMENT, 207 GL_RENDERBUFFER, depth_stencil_impl->current_renderbuffer->id); 208 checkGLcall("glFramebufferRenderbuffer()"); 209 209 } 210 210 211 211 if (format_flags & WINED3DFMT_FLAG_STENCIL) 212 212 { 213 GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT,214 GL_RENDERBUFFER _EXT, depth_stencil_impl->current_renderbuffer->id));215 checkGLcall("glFramebufferRenderbuffer EXT()");213 gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_STENCIL_ATTACHMENT, 214 GL_RENDERBUFFER, depth_stencil_impl->current_renderbuffer->id); 215 checkGLcall("glFramebufferRenderbuffer()"); 216 216 } 217 217 } … … 222 222 if (format_flags & WINED3DFMT_FLAG_DEPTH) 223 223 { 224 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT,224 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, 225 225 depth_stencil_impl->texture_target, depth_stencil_impl->texture_name, 226 depth_stencil_impl->texture_level) );227 checkGLcall("glFramebufferTexture2D EXT()");226 depth_stencil_impl->texture_level); 227 checkGLcall("glFramebufferTexture2D()"); 228 228 } 229 229 230 230 if (format_flags & WINED3DFMT_FLAG_STENCIL) 231 231 { 232 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT,232 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT, 233 233 depth_stencil_impl->texture_target, depth_stencil_impl->texture_name, 234 depth_stencil_impl->texture_level) );235 checkGLcall("glFramebufferTexture2D EXT()");234 depth_stencil_impl->texture_level); 235 checkGLcall("glFramebufferTexture2D()"); 236 236 } 237 237 } … … 239 239 if (!(format_flags & WINED3DFMT_FLAG_DEPTH)) 240 240 { 241 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));242 checkGLcall("glFramebufferTexture2D EXT()");241 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 242 checkGLcall("glFramebufferTexture2D()"); 243 243 } 244 244 245 245 if (!(format_flags & WINED3DFMT_FLAG_STENCIL)) 246 246 { 247 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));248 checkGLcall("glFramebufferTexture2D EXT()");247 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 248 checkGLcall("glFramebufferTexture2D()"); 249 249 } 250 250 } 251 251 else 252 252 { 253 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));254 checkGLcall("glFramebufferTexture2D EXT()");255 256 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0));257 checkGLcall("glFramebufferTexture2D EXT()");253 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 254 checkGLcall("glFramebufferTexture2D()"); 255 256 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 257 checkGLcall("glFramebufferTexture2D()"); 258 258 } 259 259 } … … 272 272 context_apply_attachment_filter_states(surface, TRUE); 273 273 274 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, surface_impl->texture_target, 275 surface_impl->texture_name, surface_impl->texture_level)); 276 checkGLcall("glFramebufferTexture2DEXT()"); 277 } else { 278 GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, GL_TEXTURE_2D, 0, 0)); 279 checkGLcall("glFramebufferTexture2DEXT()"); 274 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, surface_impl->texture_target, 275 surface_impl->texture_name, surface_impl->texture_level); 276 checkGLcall("glFramebufferTexture2D()"); 277 } 278 else 279 { 280 gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, GL_TEXTURE_2D, 0, 0); 281 checkGLcall("glFramebufferTexture2D()"); 280 282 } 281 283 } … … 287 289 GLenum status; 288 290 289 status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));290 if (status == GL_FRAMEBUFFER_COMPLETE _EXT)291 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER); 292 if (status == GL_FRAMEBUFFER_COMPLETE) 291 293 { 292 294 TRACE("FBO complete\n"); … … 295 297 unsigned int i; 296 298 FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status); 297 298 299 299 300 if (context->current_fbo) … … 308 309 i, attachment, debug_d3dformat(attachment->resource.format_desc->format), 309 310 attachment->pow2Width, attachment->pow2Height); 310 311 311 } 312 312 } … … 344 344 const struct wined3d_gl_info *gl_info = context->gl_info; 345 345 346 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &entry->id);346 context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id); 347 347 context_clean_fbo_attachments(gl_info); 348 348 … … 409 409 unsigned int i; 410 410 411 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &entry->id);411 context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id); 412 412 413 413 if (!entry->attached) … … 417 417 { 418 418 IWineD3DSurface *render_target = device->render_targets[i]; 419 context_attach_surface_fbo(context, GL_FRAMEBUFFER _EXT, i, render_target);419 context_attach_surface_fbo(context, GL_FRAMEBUFFER, i, render_target); 420 420 } 421 421 … … 428 428 surface_set_compatible_renderbuffer(device->stencilBufferTarget, w, h); 429 429 } 430 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER _EXT, device->stencilBufferTarget, TRUE);430 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, device->stencilBufferTarget, TRUE); 431 431 432 432 entry->attached = TRUE; … … 444 444 { 445 445 if (device->render_targets[i]) 446 device->draw_buffers[i] = GL_COLOR_ATTACHMENT0 _EXT+ i;446 device->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i; 447 447 else 448 448 device->draw_buffers[i] = GL_NONE; … … 459 459 } else { 460 460 context->current_fbo = NULL; 461 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);461 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 462 462 } 463 463 … … 690 690 } 691 691 692 GL_EXTCALL(glDeleteQueriesARB(context->free_occlusion_query_count, context->free_occlusion_queries)); 692 if (GL_SUPPORT(ARB_OCCLUSION_QUERY)) 693 GL_EXTCALL(glDeleteQueriesARB(context->free_occlusion_query_count, context->free_occlusion_queries)); 693 694 694 695 if (GL_SUPPORT(APPLE_FENCE)) … … 771 772 if (!pwglMakeCurrent(ctx->hdc, ctx->glCtx)) 772 773 { 773 ERR("Failed to make GL context %p current on device context %p.\n", ctx->glCtx, ctx->hdc); 774 DWORD err = GetLastError(); 775 ERR("Failed to make GL context %p current on device context %p, last error %#x.\n", 776 ctx->glCtx, ctx->hdc, err); 777 TlsSetValue(wined3d_context_tls_idx, NULL); 774 778 return FALSE; 775 779 } 776 780 ctx->current = 1; 777 781 } 778 else 782 else if(pwglGetCurrentContext()) 779 783 { 780 784 TRACE("Clearing current D3D context.\n"); 781 785 if (!pwglMakeCurrent(NULL, NULL)) 782 786 { 783 ERR("Failed to clear current GL context.\n");784 /*In case of failure, wglMakeCurrent makes current GLRC not current anyway.*/787 DWORD err = GetLastError(); 788 ERR("Failed to clear current GL context, last error %#x.\n", err); 785 789 TlsSetValue(wined3d_context_tls_idx, NULL); 786 790 return FALSE; … … 810 814 BYTE shift; 811 815 812 if (!rep ||isStateDirty(context, rep)) return;816 if (isStateDirty(context, rep)) return; 813 817 814 818 context->dirtyArray[context->numDirtyEntries++] = rep; … … 867 871 */ 868 872 for(state = 0; state <= STATE_HIGHEST; state++) { 869 Context_MarkStateDirty(This->contexts[This->numContexts], state, This->StateTable); 873 if (This->StateTable[state].representative) 874 Context_MarkStateDirty(This->contexts[This->numContexts], state, This->StateTable); 870 875 } 871 876 … … 930 935 * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this 931 936 * issue needs to be fixed. */ 932 if (ds_format_desc->format != WINED3DFMT_ D24S8)937 if (ds_format_desc->format != WINED3DFMT_S8_UINT_D24_UNORM) 933 938 { 934 939 FIXME("Add OpenGL context recreation support to SetDepthStencilSurface\n"); 935 ds_format_desc = getFormatDescEntry(WINED3DFMT_ D24S8, &This->adapter->gl_info);940 ds_format_desc = getFormatDescEntry(WINED3DFMT_S8_UINT_D24_UNORM, &This->adapter->gl_info); 936 941 } 937 942 … … 1145 1150 auxBuffers = TRUE; 1146 1151 1147 if (color_format_desc->format == WINED3DFMT_ X4R4G4B4)1148 color_format_desc = getFormatDescEntry(WINED3DFMT_ A4R4G4B4, &This->adapter->gl_info);1149 else if (color_format_desc->format == WINED3DFMT_ X8R8G8B8)1150 color_format_desc = getFormatDescEntry(WINED3DFMT_ A8R8G8B8, &This->adapter->gl_info);1152 if (color_format_desc->format == WINED3DFMT_B4G4R4X4_UNORM) 1153 color_format_desc = getFormatDescEntry(WINED3DFMT_B4G4R4A4_UNORM, &This->adapter->gl_info); 1154 else if (color_format_desc->format == WINED3DFMT_B8G8R8X8_UNORM) 1155 color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info); 1151 1156 } 1152 1157 … … 1155 1160 * The conversion (ab)uses the alpha component for storing the palette index. For this reason we require 1156 1161 * a format with 8bit alpha, so request A8R8G8B8. */ 1157 if (color_format_desc->format == WINED3DFMT_P8 )1158 color_format_desc = getFormatDescEntry(WINED3DFMT_ A8R8G8B8, &This->adapter->gl_info);1162 if (color_format_desc->format == WINED3DFMT_P8_UINT) 1163 color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info); 1159 1164 1160 1165 /* Retrieve the depth stencil format from the present parameters. … … 1374 1379 checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)"); 1375 1380 } 1381 1382 if (GL_SUPPORT(ARB_PROVOKING_VERTEX)) 1383 { 1384 GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION)); 1385 } 1386 else if (GL_SUPPORT(EXT_PROVOKING_VERTEX)) 1387 { 1388 GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT)); 1389 } 1390 1376 1391 LEAVE_GL(); 1377 1392 … … 1524 1539 static inline void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *context, UINT width, UINT height) 1525 1540 { 1526 int i , sampler;1541 int i; 1527 1542 const struct StateEntry *StateTable = This->StateTable; 1528 1543 const struct wined3d_gl_info *gl_info = context->gl_info; 1544 DWORD sampler; 1529 1545 1530 1546 TRACE("Setting up context %p for blitting\n", context); … … 1589 1605 checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);"); 1590 1606 1591 if (sampler != -1) { 1607 if (sampler != WINED3D_UNMAPPED_STAGE) 1608 { 1592 1609 if (sampler < MAX_TEXTURES) { 1593 1610 Context_MarkStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP), StateTable); … … 1628 1645 } 1629 1646 1630 if (sampler != -1) { 1647 if (sampler != WINED3D_UNMAPPED_STAGE) 1648 { 1631 1649 if (sampler < MAX_TEXTURES) { 1632 1650 Context_MarkStateDirty(context, STATE_TRANSFORM(WINED3DTS_TEXTURE0 + sampler), StateTable); … … 1856 1874 if (context->render_offscreen != old_render_offscreen) 1857 1875 { 1858 Context_MarkStateDirty(context, WINED3DTS_PROJECTION, StateTable);1876 Context_MarkStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION), StateTable); 1859 1877 Context_MarkStateDirty(context, STATE_VDECL, StateTable); 1860 1878 Context_MarkStateDirty(context, STATE_VIEWPORT, StateTable); … … 1964 1982 } 1965 1983 } else { 1966 glDrawBuffer(GL_COLOR_ATTACHMENT0 _EXT);1984 glDrawBuffer(GL_COLOR_ATTACHMENT0); 1967 1985 checkGLcall("glDrawBuffer()"); 1968 1986 } … … 2046 2064 FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n"); 2047 2065 ENTER_GL(); 2048 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &context->dst_fbo);2049 context_attach_surface_fbo(context, GL_FRAMEBUFFER _EXT, 0, target);2050 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER _EXT, NULL, FALSE);2066 context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo); 2067 context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, target); 2068 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE); 2051 2069 LEAVE_GL(); 2052 2070 } else { 2053 2071 ENTER_GL(); 2054 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);2072 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 2055 2073 LEAVE_GL(); 2056 2074 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
r22496 r23571 6 6 * Copyright 2005 Oliver Stieber 7 7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 65 66 break; 66 67 } 67 dirty = srgb_mode ? &This->baseTexture. srgbDirty : &This->baseTexture.dirty;68 dirty = srgb_mode ? &This->baseTexture.texture_srgb.dirty : &This->baseTexture.texture_rgb.dirty; 68 69 69 70 TRACE("(%p) : About to load texture: dirtified(%u).\n", This, *dirty); … … 79 80 } 80 81 81 if (This->resource.format_desc->format == WINED3DFMT_P8 82 || This->resource.format_desc->format == WINED3DFMT_ A8P8)82 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 83 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 83 84 { 84 85 for (i = 0; i < This->baseTexture.levels; ++i) … … 120 121 } 121 122 122 static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This , D3DCB_DESTROYSURFACEFN surface_destroy_cb)123 static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This) 123 124 { 124 125 unsigned int i, j; … … 140 141 surface_set_texture_target(surface, 0); 141 142 IWineD3DSurface_SetContainer(surface, NULL); 142 surface_destroy_cb(surface);143 IWineD3DSurface_Release(surface); 143 144 } 144 145 } 145 146 } 146 147 basetexture_cleanup((IWineD3DBaseTexture *)This); 147 }148 149 HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,150 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)151 {152 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;153 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);154 UINT pow2_edge_length;155 unsigned int i, j;156 UINT tmp_w;157 HRESULT hr;158 159 /* TODO: It should only be possible to create textures for formats160 * that are reported as supported. */161 if (WINED3DFMT_UNKNOWN >= format)162 {163 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);164 return WINED3DERR_INVALIDCALL;165 }166 167 if (!GL_SUPPORT(ARB_TEXTURE_CUBE_MAP) && pool != WINED3DPOOL_SCRATCH)168 {169 WARN("(%p) : Tried to create not supported cube texture.\n", texture);170 return WINED3DERR_INVALIDCALL;171 }172 173 /* Calculate levels for mip mapping */174 if (usage & WINED3DUSAGE_AUTOGENMIPMAP)175 {176 if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))177 {178 WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");179 return WINED3DERR_INVALIDCALL;180 }181 182 if (levels > 1)183 {184 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");185 return WINED3DERR_INVALIDCALL;186 }187 188 levels = 1;189 }190 else if (!levels)191 {192 levels = wined3d_log2i(edge_length) + 1;193 TRACE("Calculated levels = %u.\n", levels);194 }195 196 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,197 WINED3DRTYPE_CUBETEXTURE, device, 0, usage, format_desc, pool, parent);198 if (FAILED(hr))199 {200 WARN("Failed to initialize basetexture, returning %#x\n", hr);201 return hr;202 }203 204 /* Find the nearest pow2 match. */205 pow2_edge_length = 1;206 while (pow2_edge_length < edge_length) pow2_edge_length <<= 1;207 208 if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO) || (edge_length == pow2_edge_length))209 {210 /* Precalculated scaling for 'faked' non power of two texture coords. */211 texture->baseTexture.pow2Matrix[0] = 1.0f;212 texture->baseTexture.pow2Matrix[5] = 1.0f;213 texture->baseTexture.pow2Matrix[10] = 1.0f;214 texture->baseTexture.pow2Matrix[15] = 1.0f;215 }216 else217 {218 /* Precalculated scaling for 'faked' non power of two texture coords. */219 texture->baseTexture.pow2Matrix[0] = ((float)edge_length) / ((float)pow2_edge_length);220 texture->baseTexture.pow2Matrix[5] = ((float)edge_length) / ((float)pow2_edge_length);221 texture->baseTexture.pow2Matrix[10] = ((float)edge_length) / ((float)pow2_edge_length);222 texture->baseTexture.pow2Matrix[15] = 1.0f;223 texture->baseTexture.pow2Matrix_identity = FALSE;224 }225 226 /* Generate all the surfaces. */227 tmp_w = edge_length;228 for (i = 0; i < texture->baseTexture.levels; ++i)229 {230 /* Create the 6 faces. */231 for (j = 0; j < 6; ++j)232 {233 static const GLenum cube_targets[6] =234 {235 GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,236 GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,237 GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,238 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,239 GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,240 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,241 };242 243 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,244 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]);245 if (FAILED(hr))246 {247 FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);248 texture->surfaces[j][i] = NULL;249 cubetexture_cleanup(texture, D3DCB_DefaultDestroySurface);250 return hr;251 }252 253 IWineD3DSurface_SetContainer(texture->surfaces[j][i], (IWineD3DBase *)texture);254 TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[j][i]);255 surface_set_texture_target(texture->surfaces[j][i], cube_targets[j]);256 }257 tmp_w = max(1, tmp_w >> 1);258 }259 texture->baseTexture.internal_preload = cubetexture_internal_preload;260 261 return WINED3D_OK;262 148 } 263 149 … … 298 184 TRACE("(%p) : Releasing from %d\n", This, This->resource.ref); 299 185 ref = InterlockedDecrement(&This->resource.ref); 300 if (ref == 0) { 301 IWineD3DCubeTexture_Destroy(iface, D3DCB_DefaultDestroySurface); 186 if (!ref) 187 { 188 cubetexture_cleanup(This); 189 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 190 HeapFree(GetProcessHeap(), 0, This); 302 191 } 303 192 return ref; … … 414 303 for (j = WINED3DCUBEMAP_FACE_POSITIVE_X; j <= WINED3DCUBEMAP_FACE_NEGATIVE_Z; ++j) { 415 304 if(This->baseTexture.is_srgb) { 416 surface_set_texture_name(This->surfaces[j][i], This->baseTexture. srgbTextureName, TRUE);305 surface_set_texture_name(This->surfaces[j][i], This->baseTexture.texture_srgb.name, TRUE); 417 306 } else { 418 surface_set_texture_name(This->surfaces[j][i], This->baseTexture.texture Name, FALSE);307 surface_set_texture_name(This->surfaces[j][i], This->baseTexture.texture_rgb.name, FALSE); 419 308 } 420 309 } … … 442 331 IWineD3DCubeTexture IWineD3DCubeTexture parts follow 443 332 ******************************************* */ 444 static void WINAPI IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {445 IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;446 447 cubetexture_cleanup(This, D3DCB_DestroySurface);448 /* finally delete the object */449 HeapFree(GetProcessHeap(), 0, This);450 }451 452 333 static HRESULT WINAPI IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture *iface, UINT Level, WINED3DSURFACE_DESC* pDesc) { 453 334 IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface; … … 516 397 HRESULT hr = WINED3DERR_INVALIDCALL; 517 398 IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface; 518 This->baseTexture. dirty = TRUE;519 This->baseTexture. srgbDirty = TRUE;399 This->baseTexture.texture_rgb.dirty = TRUE; 400 This->baseTexture.texture_srgb.dirty = TRUE; 520 401 TRACE("(%p) : dirtyfication of faceType(%d) Level (0)\n", This, FaceType); 521 402 if (FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) { … … 528 409 } 529 410 530 531 const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = 411 static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = 532 412 { 533 413 /* IUnknown */ … … 559 439 IWineD3DCubeTextureImpl_IsCondNP2, 560 440 /* IWineD3DCubeTexture */ 561 IWineD3DCubeTextureImpl_Destroy,562 441 IWineD3DCubeTextureImpl_GetLevelDesc, 563 442 IWineD3DCubeTextureImpl_GetCubeMapSurface, … … 566 445 IWineD3DCubeTextureImpl_AddDirtyRect 567 446 }; 447 448 HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels, 449 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 450 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 451 { 452 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 453 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); 454 UINT pow2_edge_length; 455 unsigned int i, j; 456 UINT tmp_w; 457 HRESULT hr; 458 459 /* TODO: It should only be possible to create textures for formats 460 * that are reported as supported. */ 461 if (WINED3DFMT_UNKNOWN >= format) 462 { 463 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); 464 return WINED3DERR_INVALIDCALL; 465 } 466 467 if (!gl_info->supported[ARB_TEXTURE_CUBE_MAP] && pool != WINED3DPOOL_SCRATCH) 468 { 469 WARN("(%p) : Tried to create not supported cube texture.\n", texture); 470 return WINED3DERR_INVALIDCALL; 471 } 472 473 /* Calculate levels for mip mapping */ 474 if (usage & WINED3DUSAGE_AUTOGENMIPMAP) 475 { 476 if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) 477 { 478 WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); 479 return WINED3DERR_INVALIDCALL; 480 } 481 482 if (levels > 1) 483 { 484 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); 485 return WINED3DERR_INVALIDCALL; 486 } 487 488 levels = 1; 489 } 490 else if (!levels) 491 { 492 levels = wined3d_log2i(edge_length) + 1; 493 TRACE("Calculated levels = %u.\n", levels); 494 } 495 496 texture->lpVtbl = &IWineD3DCubeTexture_Vtbl; 497 498 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_CUBETEXTURE, 499 device, 0, usage, format_desc, pool, parent, parent_ops); 500 if (FAILED(hr)) 501 { 502 WARN("Failed to initialize basetexture, returning %#x\n", hr); 503 return hr; 504 } 505 506 /* Find the nearest pow2 match. */ 507 pow2_edge_length = 1; 508 while (pow2_edge_length < edge_length) pow2_edge_length <<= 1; 509 510 if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || (edge_length == pow2_edge_length)) 511 { 512 /* Precalculated scaling for 'faked' non power of two texture coords. */ 513 texture->baseTexture.pow2Matrix[0] = 1.0f; 514 texture->baseTexture.pow2Matrix[5] = 1.0f; 515 texture->baseTexture.pow2Matrix[10] = 1.0f; 516 texture->baseTexture.pow2Matrix[15] = 1.0f; 517 } 518 else 519 { 520 /* Precalculated scaling for 'faked' non power of two texture coords. */ 521 texture->baseTexture.pow2Matrix[0] = ((float)edge_length) / ((float)pow2_edge_length); 522 texture->baseTexture.pow2Matrix[5] = ((float)edge_length) / ((float)pow2_edge_length); 523 texture->baseTexture.pow2Matrix[10] = ((float)edge_length) / ((float)pow2_edge_length); 524 texture->baseTexture.pow2Matrix[15] = 1.0f; 525 texture->baseTexture.pow2Matrix_identity = FALSE; 526 } 527 528 /* Generate all the surfaces. */ 529 tmp_w = edge_length; 530 for (i = 0; i < texture->baseTexture.levels; ++i) 531 { 532 /* Create the 6 faces. */ 533 for (j = 0; j < 6; ++j) 534 { 535 static const GLenum cube_targets[6] = 536 { 537 GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 538 GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 539 GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 540 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 541 GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 542 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 543 }; 544 545 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, 546 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]); 547 if (FAILED(hr)) 548 { 549 FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr); 550 texture->surfaces[j][i] = NULL; 551 cubetexture_cleanup(texture); 552 return hr; 553 } 554 555 IWineD3DSurface_SetContainer(texture->surfaces[j][i], (IWineD3DBase *)texture); 556 TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[j][i]); 557 surface_set_texture_target(texture->surfaces[j][i], cube_targets[j]); 558 } 559 tmp_w = max(1, tmp_w >> 1); 560 } 561 texture->baseTexture.internal_preload = cubetexture_internal_preload; 562 563 return WINED3D_OK; 564 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r22496 r23571 10 10 * Copyright 2006-2008 Henri Verbeet 11 11 * Copyright 2007 Andrew Riedi 12 * Copyright 2009 Henri Verbeet for CodeWeavers 12 13 * 13 14 * This library is free software; you can redistribute it and/or … … 192 193 unsigned int i; 193 194 194 memset(stream_info, 0, sizeof(*stream_info)); 195 stream_info->use_map = 0; 196 stream_info->swizzle_map = 0; 195 197 196 198 /* Check for transformed vertices, disable vertex shader if present. */ … … 306 308 stream_info->elements[idx].buffer_object = buffer_object; 307 309 308 if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_ A8R8G8B8)310 if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) 309 311 { 310 312 stream_info->swizzle_map |= 1 << idx; … … 368 370 if (!stream_info->elements[i].format_desc) continue; 369 371 370 if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && stream_info->elements[i].format_desc->format == WINED3DFMT_A8R8G8B8) 372 if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) 373 && stream_info->elements[i].format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) 371 374 { 372 375 stream_info->swizzle_map |= 1 << i; … … 450 453 } 451 454 452 static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface, 453 struct wined3d_buffer_desc *desc, const void *data, IUnknown *parent, IWineD3DBuffer **buffer)455 static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface, struct wined3d_buffer_desc *desc, 456 const void *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DBuffer **buffer) 454 457 { 455 458 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 456 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_UNKNOWN, &This->adapter->gl_info);457 459 struct wined3d_buffer *object; 458 460 HRESULT hr; … … 467 469 } 468 470 469 object->vtbl = &wined3d_buffer_vtbl;470 object->desc = *desc;471 472 471 FIXME("Ignoring access flags (pool)\n"); 473 472 474 hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, desc->byte_width,475 desc->usage, format_desc, WINED3DPOOL_MANAGED, parent);473 hr = buffer_init(object, This, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN, 474 WINED3DPOOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops); 476 475 if (FAILED(hr)) 477 476 { 478 WARN("Failed to initialize resource, returning %#x\n", hr);477 WARN("Failed to initialize buffer, hr %#x.\n", hr); 479 478 HeapFree(GetProcessHeap(), 0, object); 480 479 return hr; 481 480 } 482 object->buffer_type_hint = GL_ARRAY_BUFFER_ARB; 483 484 TRACE("Created resource %p\n", object); 485 486 TRACE("size %#x, usage=%#x, format %s, memory @ %p, iface @ %p\n", object->resource.size, object->resource.usage, 487 debug_d3dformat(object->resource.format_desc->format), object->resource.allocatedMemory, object); 488 489 if (data) 490 { 491 BYTE *ptr; 492 493 hr = IWineD3DBuffer_Map((IWineD3DBuffer *)object, 0, desc->byte_width, &ptr, 0); 494 if (FAILED(hr)) 495 { 496 ERR("Failed to map buffer, hr %#x\n", hr); 497 IWineD3DBuffer_Release((IWineD3DBuffer *)object); 498 return hr; 499 } 500 501 memcpy(ptr, data, desc->byte_width); 502 503 hr = IWineD3DBuffer_Unmap((IWineD3DBuffer *)object); 504 if (FAILED(hr)) 505 { 506 ERR("Failed to unmap buffer, hr %#x\n", hr); 507 IWineD3DBuffer_Release((IWineD3DBuffer *)object); 508 return hr; 509 } 510 } 481 object->desc = *desc; 482 483 TRACE("Created buffer %p.\n", object); 511 484 512 485 *buffer = (IWineD3DBuffer *)object; … … 515 488 } 516 489 517 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, DWORD Usage, 518 DWORD FVF, WINED3DPOOL Pool, IWineD3DBuffer **ppVertexBuffer, IUnknown *parent) 490 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, 491 DWORD Usage, DWORD FVF, WINED3DPOOL Pool, IWineD3DBuffer **ppVertexBuffer, 492 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 519 493 { 520 494 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 521 /* Dummy format for now */522 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_VERTEXDATA, &This->adapter->gl_info);523 495 struct wined3d_buffer *object; 524 496 int dxVersion = ( (IWineD3DImpl *) This->wineD3D)->dxVersion; … … 526 498 BOOL conv; 527 499 528 if(Size == 0) { 529 WARN("Size 0 requested, returning WINED3DERR_INVALIDCALL\n"); 530 *ppVertexBuffer = NULL; 531 return WINED3DERR_INVALIDCALL; 532 } else if(Pool == WINED3DPOOL_SCRATCH) { 500 if (Pool == WINED3DPOOL_SCRATCH) 501 { 533 502 /* The d3d9 testsuit shows that this is not allowed. It doesn't make much sense 534 503 * anyway, SCRATCH vertex buffers aren't usable anywhere … … 547 516 } 548 517 549 object->vtbl = &wined3d_buffer_vtbl;550 hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, Size, Usage, format_desc, Pool, parent);518 hr = buffer_init(object, This, Size, Usage, WINED3DFMT_VERTEXDATA, 519 Pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops); 551 520 if (FAILED(hr)) 552 521 { 553 WARN("Failed to initialize resource, returning %#x\n", hr);522 WARN("Failed to initialize buffer, hr %#x.\n", hr); 554 523 HeapFree(GetProcessHeap(), 0, object); 555 *ppVertexBuffer = NULL;556 524 return hr; 557 525 } 558 object->buffer_type_hint = GL_ARRAY_BUFFER_ARB; 559 560 TRACE("(%p) : Created resource %p\n", This, object); 561 562 TRACE("(%p) : Size=%d, Usage=0x%08x, FVF=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Size, Usage, FVF, Pool, object->resource.allocatedMemory, object); 526 527 TRACE("Created buffer %p.\n", object); 528 TRACE("FVF %#x, Pool %#x.\n", FVF, Pool); 563 529 *ppVertexBuffer = (IWineD3DBuffer *)object; 564 530 … … 594 560 595 561 static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface, 596 UINT Length, DWORD Usage, WINED3DPOOL Pool, IWineD3DBuffer **ppIndexBuffer, IUnknown *parent) 562 UINT Length, DWORD Usage, WINED3DPOOL Pool, IWineD3DBuffer **ppIndexBuffer, 563 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 597 564 { 598 565 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 599 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(WINED3DFMT_UNKNOWN, &This->adapter->gl_info);600 566 struct wined3d_buffer *object; 601 567 HRESULT hr; … … 612 578 } 613 579 614 object->vtbl = &wined3d_buffer_vtbl;615 hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_BUFFER, This, Length, Usage, format_desc, Pool, parent);580 hr = buffer_init(object, This, Length, Usage, WINED3DFMT_UNKNOWN, 581 Pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL, parent, parent_ops); 616 582 if (FAILED(hr)) 617 583 { 618 WARN("Failed to initialize resource, returning%#x\n", hr);584 WARN("Failed to initialize buffer, hr %#x\n", hr); 619 585 HeapFree(GetProcessHeap(), 0, object); 620 *ppIndexBuffer = NULL;621 586 return hr; 622 587 } 623 object->buffer_type_hint = GL_ELEMENT_ARRAY_BUFFER_ARB; 624 625 TRACE("(%p) : Created resource %p\n", This, object); 588 589 TRACE("Created buffer %p.\n", object); 626 590 627 591 if(Pool != WINED3DPOOL_SYSTEMMEM && !(Usage & WINED3DUSAGE_DYNAMIC) && GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT)) { … … 629 593 } 630 594 631 TRACE("(%p) : Len=%d, Use=%x, Pool=%d - Memory@%p, Iface@%p\n", This, Length, Usage,632 Pool, object, object->resource.allocatedMemory);633 595 *ppIndexBuffer = (IWineD3DBuffer *) object; 634 596 … … 909 871 WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface, 910 872 DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, 911 WINED3DSURFTYPE Impl, IUnknown *parent )873 WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 912 874 { 913 875 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 932 894 933 895 hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable, 934 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent );896 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops); 935 897 if (FAILED(hr)) 936 898 { … … 972 934 973 935 static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, 974 UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, 975 WINED3DPOOL Pool, IWineD3DTexture **ppTexture, IUnknown *parent)936 UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, 937 IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 976 938 { 977 939 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 991 953 } 992 954 993 object->lpVtbl = &IWineD3DTexture_Vtbl; 994 995 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent); 955 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops); 996 956 if (FAILED(hr)) 997 957 { … … 1010 970 1011 971 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *iface, 1012 UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format, 1013 WINED3DPOOL Pool, IWineD3DVolumeTexture **ppVolumeTexture, IUnknown *parent)972 UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, 973 IWineD3DVolumeTexture **ppVolumeTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 1014 974 { 1015 975 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 1028 988 } 1029 989 1030 object->lpVtbl = &IWineD3DVolumeTexture_Vtbl; 1031 hr = volumetexture_init(object, Width, Height, Depth, Levels, This, Usage, Format, Pool, parent); 990 hr = volumetexture_init(object, Width, Height, Depth, Levels, This, Usage, Format, Pool, parent, parent_ops); 1032 991 if (FAILED(hr)) 1033 992 { … … 1044 1003 } 1045 1004 1046 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, 1047 UINT Width, UINT Height, UINT Depth, DWORD Usage, WINED3DFORMAT Format,1048 WINED3DPOOL Pool, IWineD3DVolume **ppVolume, IUnknown *parent)1005 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UINT Width, UINT Height, 1006 UINT Depth, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DVolume **ppVolume, 1007 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 1049 1008 { 1050 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1051 IWineD3DVolumeImpl *object; /** NOTE: impl ref allowed since this is a create function **/ 1052 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(Format, &GLINFO_LOCATION); 1009 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1010 IWineD3DVolumeImpl *object; 1053 1011 HRESULT hr; 1054 1012 1055 if(!GL_SUPPORT(EXT_TEXTURE3D)) { 1056 WARN("(%p) : Volume cannot be created - no volume texture support\n", This); 1057 return WINED3DERR_INVALIDCALL; 1058 } 1013 TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height, 1014 Depth, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool)); 1059 1015 1060 1016 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); … … 1066 1022 } 1067 1023 1068 object->lpVtbl = &IWineD3DVolume_Vtbl; 1069 hr = resource_init((IWineD3DResource *)object, WINED3DRTYPE_VOLUME, This, 1070 Width * Height * Depth * format_desc->byte_count, Usage, format_desc, Pool, parent); 1024 hr = volume_init(object, This, Width, Height, Depth, Usage, Format, Pool, parent, parent_ops); 1071 1025 if (FAILED(hr)) 1072 1026 { 1073 WARN("Failed to initialize resource, returning %#x\n", hr);1027 WARN("Failed to initialize volume, returning %#x.\n", hr); 1074 1028 HeapFree(GetProcessHeap(), 0, object); 1075 *ppVolume = NULL;1076 1029 return hr; 1077 1030 } 1078 1031 1079 TRACE("(%p) : Created resource %p\n", This, object); 1080 1032 TRACE("(%p) : Created volume %p.\n", This, object); 1081 1033 *ppVolume = (IWineD3DVolume *)object; 1082 1034 1083 TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height, 1084 Depth, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool)); 1085 1086 object->currentDesc.Width = Width; 1087 object->currentDesc.Height = Height; 1088 object->currentDesc.Depth = Depth; 1089 1090 /** Note: Volume textures cannot be dxtn, hence no need to check here **/ 1091 object->lockable = TRUE; 1092 object->locked = FALSE; 1093 memset(&object->lockedBox, 0, sizeof(WINED3DBOX)); 1094 object->dirty = TRUE; 1095 1096 volume_add_dirty_box((IWineD3DVolume *)object, NULL); 1097 1098 return WINED3D_OK; 1099 } 1100 1101 static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, 1102 UINT EdgeLength, UINT Levels, DWORD Usage, WINED3DFORMAT Format, 1103 WINED3DPOOL Pool, IWineD3DCubeTexture **ppCubeTexture, IUnknown *parent) 1035 return WINED3D_OK; 1036 } 1037 1038 static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength, UINT Levels, 1039 DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DCubeTexture **ppCubeTexture, 1040 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 1104 1041 { 1105 1042 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 1115 1052 } 1116 1053 1117 object->lpVtbl = &IWineD3DCubeTexture_Vtbl; 1118 hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent); 1054 hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent, parent_ops); 1119 1055 if (FAILED(hr)) 1120 1056 { … … 1351 1287 IWineD3DSwapChainImpl *object; /** NOTE: impl ref allowed since this is a create function **/ 1352 1288 HRESULT hr; 1353 IUnknown *bufferParent;1354 1289 BOOL displaymode_set = FALSE; 1355 1290 WINED3DDISPLAYMODE Mode; … … 1612 1547 UINT i; 1613 1548 for(i = 0; i < object->presentParms.BackBufferCount; i++) { 1614 if(object->backBuffer[i]) { 1615 IWineD3DSurface_GetParent(object->backBuffer[i], &bufferParent); 1616 IUnknown_Release(bufferParent); /* once for the get parent */ 1617 if (IUnknown_Release(bufferParent) > 0) { 1618 FIXME("(%p) Something's still holding the back buffer\n",This); 1619 } 1620 } 1549 if (object->backBuffer[i]) IWineD3DSurface_Release(object->backBuffer[i]); 1621 1550 } 1622 1551 HeapFree(GetProcessHeap(), 0, object->backBuffer); … … 1625 1554 if(object->context && object->context[0]) 1626 1555 DestroyContext(This, object->context[0]); 1627 if(object->frontBuffer) { 1628 IWineD3DSurface_GetParent(object->frontBuffer, &bufferParent); 1629 IUnknown_Release(bufferParent); /* once for the get parent */ 1630 if (IUnknown_Release(bufferParent) > 0) { 1631 FIXME("(%p) Something's still holding the front buffer\n",This); 1632 } 1633 } 1556 if (object->frontBuffer) IWineD3DSurface_Release(object->frontBuffer); 1634 1557 HeapFree(GetProcessHeap(), 0, object); 1635 1558 return hr; … … 1660 1583 } 1661 1584 1662 /***** 1663 * Vertex Declaration 1664 *****/ 1665 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration, 1666 IUnknown *parent, const WINED3DVERTEXELEMENT *elements, UINT element_count) { 1667 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1585 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice *iface, 1586 IWineD3DVertexDeclaration **declaration, IUnknown *parent, const struct wined3d_parent_ops *parent_ops, 1587 const WINED3DVERTEXELEMENT *elements, UINT element_count) 1588 { 1589 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1668 1590 IWineD3DVertexDeclarationImpl *object = NULL; 1669 HRESULT hr = WINED3D_OK;1670 1671 TRACE(" (%p) : directXVersion %u, elements %p, element_count %d, ppDecl=%p\n",1672 This, ((IWineD3DImpl *)This->wineD3D)->dxVersion, elements, element_count, ppVertexDeclaration);1591 HRESULT hr; 1592 1593 TRACE("iface %p, declaration %p, parent %p, elements %p, element_count %u.\n", 1594 iface, declaration, parent, elements, element_count); 1673 1595 1674 1596 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); 1675 1597 if(!object) 1676 1598 { 1677 ERR("Out of memory\n"); 1678 *ppVertexDeclaration = NULL; 1679 return WINED3DERR_OUTOFVIDEOMEMORY; 1680 } 1681 1682 object->lpVtbl = &IWineD3DVertexDeclaration_Vtbl; 1683 object->wineD3DDevice = This; 1684 object->parent = parent; 1685 object->ref = 1; 1686 1687 *ppVertexDeclaration = (IWineD3DVertexDeclaration *)object; 1688 1689 hr = vertexdeclaration_init(object, elements, element_count); 1690 1691 if(FAILED(hr)) { 1692 IWineD3DVertexDeclaration_Release((IWineD3DVertexDeclaration *)object); 1693 *ppVertexDeclaration = NULL; 1694 } 1695 1696 return hr; 1599 ERR("Failed to allocate vertex declaration memory.\n"); 1600 return E_OUTOFMEMORY; 1601 } 1602 1603 hr = vertexdeclaration_init(object, This, elements, element_count, parent, parent_ops); 1604 if (FAILED(hr)) 1605 { 1606 WARN("Failed to initialize vertex declaration, hr %#x.\n", hr); 1607 HeapFree(GetProcessHeap(), 0, object); 1608 return hr; 1609 } 1610 1611 TRACE("Created verrtex declaration %p.\n", object); 1612 *declaration = (IWineD3DVertexDeclaration *)object; 1613 1614 return WINED3D_OK; 1697 1615 } 1698 1616 … … 1748 1666 if (has_blend && (num_blends > 0)) { 1749 1667 if (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)) 1750 elements[idx].format = WINED3DFMT_ A8R8G8B8;1668 elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM; 1751 1669 else { 1752 1670 switch(num_blends) { … … 1768 1686 elements[idx].format = WINED3DFMT_R8G8B8A8_UINT; 1769 1687 else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR) 1770 elements[idx].format = WINED3DFMT_ A8R8G8B8;1688 elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM; 1771 1689 else 1772 1690 elements[idx].format = WINED3DFMT_R32_FLOAT; … … 1788 1706 } 1789 1707 if (has_diffuse) { 1790 elements[idx].format = WINED3DFMT_ A8R8G8B8;1708 elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM; 1791 1709 elements[idx].usage = WINED3DDECLUSAGE_COLOR; 1792 1710 elements[idx].usage_idx = 0; … … 1794 1712 } 1795 1713 if (has_specular) { 1796 elements[idx].format = WINED3DFMT_ A8R8G8B8;1714 elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM; 1797 1715 elements[idx].usage = WINED3DDECLUSAGE_COLOR; 1798 1716 elements[idx].usage_idx = 1; … … 1834 1752 } 1835 1753 1836 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration, IUnknown *Parent, DWORD Fvf) { 1837 WINED3DVERTEXELEMENT* elements = NULL; 1754 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice *iface, 1755 IWineD3DVertexDeclaration **declaration, IUnknown *parent, 1756 const struct wined3d_parent_ops *parent_ops, DWORD fvf) 1757 { 1838 1758 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; 1759 WINED3DVERTEXELEMENT *elements; 1839 1760 unsigned int size; 1840 1761 DWORD hr; 1841 1762 1842 size = ConvertFvfToDeclaration(This, Fvf, &elements); 1843 if (size == ~0U) return WINED3DERR_OUTOFVIDEOMEMORY; 1844 1845 hr = IWineD3DDevice_CreateVertexDeclaration(iface, ppVertexDeclaration, Parent, elements, size); 1763 TRACE("iface %p, declaration %p, parent %p, fvf %#x.\n", iface, declaration, parent, fvf); 1764 1765 size = ConvertFvfToDeclaration(This, fvf, &elements); 1766 if (size == ~0U) return E_OUTOFMEMORY; 1767 1768 hr = IWineD3DDevice_CreateVertexDeclaration(iface, declaration, parent, parent_ops, elements, size); 1846 1769 HeapFree(GetProcessHeap(), 0, elements); 1847 if (hr != S_OK) return hr; 1848 1849 return WINED3D_OK; 1770 return hr; 1850 1771 } 1851 1772 1852 1773 static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *iface, 1853 1774 const DWORD *pFunction, const struct wined3d_shader_signature *output_signature, 1854 IWineD3DVertexShader **ppVertexShader, IUnknown *parent) 1775 IWineD3DVertexShader **ppVertexShader, IUnknown *parent, 1776 const struct wined3d_parent_ops *parent_ops) 1855 1777 { 1856 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1857 IWineD3DVertexShaderImpl *object; /* NOTE: impl usage is ok, this is a create */ 1858 HRESULT hr = WINED3D_OK; 1859 1860 if (!pFunction) return WINED3DERR_INVALIDCALL; 1778 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1779 IWineD3DVertexShaderImpl *object; 1780 HRESULT hr; 1861 1781 1862 1782 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); 1863 1783 if (!object) 1864 1784 { 1865 ERR("Out of memory\n"); 1866 *ppVertexShader = NULL; 1867 return WINED3DERR_OUTOFVIDEOMEMORY; 1868 } 1869 1870 object->lpVtbl = &IWineD3DVertexShader_Vtbl; 1871 object->parent = parent; 1872 shader_init(&object->baseShader, iface); 1873 list_add_head(&This->shaders, &object->baseShader.shader_list_entry); 1874 *ppVertexShader = (IWineD3DVertexShader *)object; 1875 1876 TRACE("(%p) : Created vertex shader %p\n", This, *ppVertexShader); 1877 1878 hr = IWineD3DVertexShader_SetFunction(*ppVertexShader, pFunction, output_signature); 1785 ERR("Failed to allocate shader memory.\n"); 1786 return E_OUTOFMEMORY; 1787 } 1788 1789 hr = vertexshader_init(object, This, pFunction, output_signature, parent, parent_ops); 1879 1790 if (FAILED(hr)) 1880 1791 { 1881 WARN("(%p) : Failed to set function, returning %#x\n", iface, hr); 1882 IWineD3DVertexShader_Release(*ppVertexShader); 1883 *ppVertexShader = NULL; 1792 WARN("Failed to initialize vertex shader, hr %#x.\n", hr); 1793 HeapFree(GetProcessHeap(), 0, object); 1884 1794 return hr; 1885 1795 } 1886 1796 1887 return hr; 1797 TRACE("Created vertex shader %p.\n", object); 1798 *ppVertexShader = (IWineD3DVertexShader *)object; 1799 1800 return WINED3D_OK; 1888 1801 } 1889 1802 1890 1803 static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface, 1891 1804 const DWORD *pFunction, const struct wined3d_shader_signature *output_signature, 1892 IWineD3DPixelShader **ppPixelShader, IUnknown *parent) 1805 IWineD3DPixelShader **ppPixelShader, IUnknown *parent, 1806 const struct wined3d_parent_ops *parent_ops) 1893 1807 { 1894 1808 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1895 IWineD3DPixelShaderImpl *object; /* NOTE: impl allowed, this is a create */ 1896 HRESULT hr = WINED3D_OK; 1897 1898 if (!pFunction) return WINED3DERR_INVALIDCALL; 1809 IWineD3DPixelShaderImpl *object; 1810 HRESULT hr; 1899 1811 1900 1812 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); 1901 1813 if (!object) 1902 1814 { 1903 ERR("Out of memory\n"); 1904 *ppPixelShader = NULL; 1905 return WINED3DERR_OUTOFVIDEOMEMORY; 1906 } 1907 1908 object->lpVtbl = &IWineD3DPixelShader_Vtbl; 1909 object->parent = parent; 1910 shader_init(&object->baseShader, iface); 1911 list_add_head(&This->shaders, &object->baseShader.shader_list_entry); 1912 *ppPixelShader = (IWineD3DPixelShader *)object; 1913 1914 TRACE("(%p) : Created pixel shader %p\n", This, *ppPixelShader); 1915 1916 hr = IWineD3DPixelShader_SetFunction(*ppPixelShader, pFunction, output_signature); 1815 ERR("Failed to allocate shader memory.\n"); 1816 return E_OUTOFMEMORY; 1817 } 1818 1819 hr = pixelshader_init(object, This, pFunction, output_signature, parent, parent_ops); 1917 1820 if (FAILED(hr)) 1918 1821 { 1919 WARN("(%p) : Failed to set function, returning %#x\n", iface, hr); 1920 IWineD3DPixelShader_Release(*ppPixelShader); 1921 *ppPixelShader = NULL; 1822 WARN("Failed to initialize pixel shader, hr %#x.\n", hr); 1823 HeapFree(GetProcessHeap(), 0, object); 1922 1824 return hr; 1923 1825 } 1924 1826 1925 return hr; 1827 TRACE("Created pixel shader %p.\n", object); 1828 *ppPixelShader = (IWineD3DPixelShader *)object; 1829 1830 return WINED3D_OK; 1926 1831 } 1927 1832 … … 1990 1895 } 1991 1896 1992 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5, TRUE, 1993 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL); 1897 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE, 1898 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, 1899 NULL, &wined3d_null_parent_ops); 1994 1900 if(FAILED(hr)) { 1995 1901 ERR("Wine logo requested, but failed to create surface\n"); … … 2123 2029 This->rev_tex_unit_map[state] = state; 2124 2030 } else { 2125 This->texUnitMap[state] = -1;2126 This->rev_tex_unit_map[state] = -1;2031 This->texUnitMap[state] = WINED3D_UNMAPPED_STAGE; 2032 This->rev_tex_unit_map[state] = WINED3D_UNMAPPED_STAGE; 2127 2033 } 2128 2034 } … … 2295 2201 } 2296 2202 2297 static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyDepthStencilSurface, D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain) { 2203 static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, 2204 D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain) 2205 { 2298 2206 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; 2207 const struct wined3d_context *context; 2208 const struct wined3d_gl_info *gl_info; 2299 2209 int sampler; 2300 2210 UINT i; … … 2306 2216 * it was created. Thus make sure a context is active for the glDelete* calls 2307 2217 */ 2308 ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 2218 context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 2219 gl_info = context->gl_info; 2309 2220 2310 2221 if(This->logo_surface) IWineD3DSurface_Release(This->logo_surface); … … 2360 2271 if (This->depth_blt_rb) { 2361 2272 ENTER_GL(); 2362 GL_EXTCALL(glDeleteRenderbuffersEXT(1, &This->depth_blt_rb));2273 gl_info->fbo_ops.glDeleteRenderbuffers(1, &This->depth_blt_rb); 2363 2274 LEAVE_GL(); 2364 2275 This->depth_blt_rb = 0; … … 2407 2318 2408 2319 if (This->auto_depth_stencil_buffer) { 2409 if(D3DCB_DestroyDepthStencilSurface(This->auto_depth_stencil_buffer) > 0) { 2320 if (IWineD3DSurface_Release(This->auto_depth_stencil_buffer) > 0) 2321 { 2410 2322 FIXME("(%p) Something's still holding the auto depth stencil buffer\n", This); 2411 2323 } … … 3163 3075 * Get / Set Indices 3164 3076 *****/ 3165 static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWineD3DBuffer* pIndexData, WINED3DFORMAT fmt) { 3166 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 3077 static HRESULT WINAPI IWineD3DDeviceImpl_SetIndexBuffer(IWineD3DDevice *iface, 3078 IWineD3DBuffer *pIndexData, WINED3DFORMAT fmt) 3079 { 3080 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 3167 3081 IWineD3DBuffer *oldIdxs; 3168 3082 … … 3197 3111 } 3198 3112 3199 static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWineD3DBuffer** ppIndexData) { 3113 static HRESULT WINAPI IWineD3DDeviceImpl_GetIndexBuffer(IWineD3DDevice *iface, IWineD3DBuffer **ppIndexData) 3114 { 3200 3115 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 3201 3116 … … 3645 3560 } 3646 3561 3647 static void device_map_stage(IWineD3DDeviceImpl *This, int stage, int unit) { 3648 int i = This->rev_tex_unit_map[unit]; 3649 int j = This->texUnitMap[stage]; 3562 static void device_map_stage(IWineD3DDeviceImpl *This, DWORD stage, DWORD unit) 3563 { 3564 DWORD i = This->rev_tex_unit_map[unit]; 3565 DWORD j = This->texUnitMap[stage]; 3650 3566 3651 3567 This->texUnitMap[stage] = unit; 3652 if (i != -1 && i != stage) { 3653 This->texUnitMap[i] = -1; 3568 if (i != WINED3D_UNMAPPED_STAGE && i != stage) 3569 { 3570 This->texUnitMap[i] = WINED3D_UNMAPPED_STAGE; 3654 3571 } 3655 3572 3656 3573 This->rev_tex_unit_map[unit] = stage; 3657 if (j != -1 && j != unit) { 3658 This->rev_tex_unit_map[j] = -1; 3574 if (j != WINED3D_UNMAPPED_STAGE && j != unit) 3575 { 3576 This->rev_tex_unit_map[j] = WINED3D_UNMAPPED_STAGE; 3659 3577 } 3660 3578 } … … 3750 3668 3751 3669 static BOOL device_unit_free_for_vs(IWineD3DDeviceImpl *This, const DWORD *pshader_sampler_tokens, 3752 const DWORD *vshader_sampler_tokens, intunit)3670 const DWORD *vshader_sampler_tokens, DWORD unit) 3753 3671 { 3754 int current_mapping = This->rev_tex_unit_map[unit]; 3755 3756 if (current_mapping == -1) { 3757 /* Not currently used */ 3758 return TRUE; 3759 } 3672 DWORD current_mapping = This->rev_tex_unit_map[unit]; 3673 3674 /* Not currently used */ 3675 if (current_mapping == WINED3D_UNMAPPED_STAGE) return TRUE; 3760 3676 3761 3677 if (current_mapping < MAX_FRAGMENT_SAMPLERS) { … … 3772 3688 3773 3689 /* Used by a vertex sampler */ 3774 return !vshader_sampler_tokens[current_mapping ];3690 return !vshader_sampler_tokens[current_mapping - MAX_FRAGMENT_SAMPLERS]; 3775 3691 } 3776 3692 … … 3779 3695 ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.reg_maps.sampler_type; 3780 3696 const WINED3DSAMPLER_TEXTURE_TYPE *pshader_sampler_type = NULL; 3781 int start = GL_LIMITS(combined_samplers) - 1;3697 int start = min(MAX_COMBINED_SAMPLERS, GL_LIMITS(combined_samplers)) - 1; 3782 3698 int i; 3783 3699 … … 3791 3707 3792 3708 for (i = 0; i < MAX_VERTEX_SAMPLERS; ++i) { 3793 intvsampler_idx = i + MAX_FRAGMENT_SAMPLERS;3709 DWORD vsampler_idx = i + MAX_FRAGMENT_SAMPLERS; 3794 3710 if (vshader_sampler_type[i]) 3795 3711 { … … 4045 3961 DWORD numTextures; 4046 3962 4047 if (stream_info-> elements[WINED3D_FFP_NORMAL].data)3963 if (stream_info->use_map & (1 << WINED3D_FFP_NORMAL)) 4048 3964 { 4049 3965 WARN(" lighting state not saved yet... Some strange stuff may happen !\n"); 4050 3966 } 4051 3967 4052 if (! stream_info->elements[WINED3D_FFP_POSITION].data)3968 if (!(stream_info->use_map & (1 << WINED3D_FFP_POSITION))) 4053 3969 { 4054 3970 ERR("Source has no position mask\n"); … … 4186 4102 if( !doClip || 4187 4103 ( (-rhw -eps < x) && (-rhw -eps < y) && ( -eps < z) && 4188 (x <= rhw + eps) && (y <= rhw + eps ) && (z <= rhw + eps) && 4104 (x <= rhw + eps) && (y <= rhw + eps ) && (z <= rhw + eps) && 4189 4105 ( rhw > eps ) ) ) { 4190 4106 … … 4283 4199 const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_DIFFUSE]; 4284 4200 const DWORD *color_d = (const DWORD *)(element->data + i * element->stride); 4285 if(!color_d) { 4201 if (!(stream_info->use_map & (1 << WINED3D_FFP_DIFFUSE))) 4202 { 4286 4203 static BOOL warned = FALSE; 4287 4204 … … 4310 4227 } 4311 4228 4312 if (DestFVF & WINED3DFVF_SPECULAR) { 4229 if (DestFVF & WINED3DFVF_SPECULAR) 4230 { 4313 4231 /* What's the color value in the feedback buffer? */ 4314 4232 const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_SPECULAR]; 4315 4233 const DWORD *color_s = (const DWORD *)(element->data + i * element->stride); 4316 if(!color_s) { 4234 if (!(stream_info->use_map & (1 << WINED3D_FFP_SPECULAR))) 4235 { 4317 4236 static BOOL warned = FALSE; 4318 4237 … … 4344 4263 const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_TEXCOORD0 + tex_index]; 4345 4264 const float *tex_coord = (const float *)(element->data + i * element->stride); 4346 if(!tex_coord) { 4265 if (!(stream_info->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + tex_index)))) 4266 { 4347 4267 ERR("No source texture, but destination requests one\n"); 4348 4268 dest_ptr+=GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float); … … 4406 4326 for (i = 0; i < (sizeof(stream_info.elements) / sizeof(*stream_info.elements)); ++i) 4407 4327 { 4408 struct wined3d_stream_info_element *e = &stream_info.elements[i]; 4328 struct wined3d_stream_info_element *e; 4329 4330 if (!(stream_info.use_map & (1 << i))) continue; 4331 4332 e = &stream_info.elements[i]; 4409 4333 if (e->buffer_object) 4410 4334 { … … 4856 4780 ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 4857 4781 /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ 4858 glFlush();4782 wglFlush(); 4859 4783 /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever 4860 4784 * fails … … 5069 4993 if (SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface *)target, &IID_IWineD3DSwapChain, (void **)&swapchain))) { 5070 4994 if (target == (IWineD3DSurfaceImpl*) swapchain->frontBuffer) { 5071 glFlush();4995 wglFlush(); 5072 4996 } 5073 4997 IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); … … 5143 5067 } 5144 5068 /* Account for the loading offset due to index buffers. Instead of reloading all sources correct it with the startvertex parameter */ 5145 drawPrimitive(iface, vertex_count, 0/* NumVertices */, StartVertex /* start_idx */, 5146 0 /* indxSize */, NULL /* indxData */, 0 /* minIndex */); 5147 return WINED3D_OK; 5148 } 5149 5150 static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface, 5151 UINT minIndex, UINT NumVertices, UINT startIndex, UINT index_count) 5069 drawPrimitive(iface, vertex_count, StartVertex /* start_idx */, 0 /* indxSize */, NULL /* indxData */); 5070 return WINED3D_OK; 5071 } 5072 5073 static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface, UINT startIndex, UINT index_count) 5152 5074 { 5153 5075 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 5177 5099 vbo = ((struct wined3d_buffer *) pIB)->buffer_object; 5178 5100 5179 TRACE("(%p) : min %u, vertex count %u, startIdx %u, index count %u\n", 5180 This, minIndex, NumVertices, startIndex, index_count); 5101 TRACE("(%p) : startIndex %u, index count %u.\n", This, startIndex, index_count); 5181 5102 5182 5103 if (This->stateBlock->IndexFmt == WINED3DFMT_R16_UINT) { … … 5191 5112 } 5192 5113 5193 drawPrimitive(iface, index_count, NumVertices,startIndex, idxStride,5194 vbo ? NULL : ((struct wined3d_buffer *) pIB)->resource.allocatedMemory, minIndex);5114 drawPrimitive(iface, index_count, startIndex, idxStride, 5115 vbo ? NULL : ((struct wined3d_buffer *)pIB)->resource.allocatedMemory); 5195 5116 5196 5117 return WINED3D_OK; … … 5223 5144 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC); 5224 5145 5225 drawPrimitive(iface, vertex_count, 0 /* NumVertices */, 0 /* start_idx */, 5226 0 /* indxSize*/, NULL /* indxData */, 0 /* indxMin */); 5146 drawPrimitive(iface, vertex_count, 0 /* start_idx */, 0 /* indxSize*/, NULL /* indxData */); 5227 5147 5228 5148 /* MSDN specifies stream zero settings must be set to NULL */ … … 5236 5156 } 5237 5157 5238 static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface, UINT MinVertexIndex,5239 UINT NumVertices, UINTindex_count, const void *pIndexData, WINED3DFORMAT IndexDataFormat,5158 static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface, 5159 UINT index_count, const void *pIndexData, WINED3DFORMAT IndexDataFormat, 5240 5160 const void *pVertexStreamZeroData, UINT VertexStreamZeroStride) 5241 5161 { … … 5245 5165 IWineD3DBuffer *ib; 5246 5166 5247 TRACE("(%p) : MinVtxIdx %u, NumVIdx %u, index count %u, pidxdata %p, IdxFmt %u, pVtxdata %p, stride=%u\n", 5248 This, MinVertexIndex, NumVertices, index_count, pIndexData, 5249 IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride); 5167 TRACE("(%p) : index count %u, pidxdata %p, IdxFmt %u, pVtxdata %p, stride=%u.\n", 5168 This, index_count, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride); 5250 5169 5251 5170 if(!This->stateBlock->vertexDecl) { … … 5275 5194 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER); 5276 5195 5277 drawPrimitive(iface, index_count, NumVertices, 0 /* start_idx */, 5278 idxStride, pIndexData, MinVertexIndex); 5196 drawPrimitive(iface, index_count, 0 /* start_idx */, idxStride, pIndexData); 5279 5197 5280 5198 /* MSDN specifies stream zero settings and index buffer must be set to NULL */ … … 5306 5224 This->stateBlock->baseVertexIndex = 0; 5307 5225 This->up_strided = DrawPrimStrideData; 5308 drawPrimitive(iface, vertex_count, 0, 0, 0, NULL, 0);5226 drawPrimitive(iface, vertex_count, 0, 0, NULL); 5309 5227 This->up_strided = NULL; 5310 5228 return WINED3D_OK; … … 5327 5245 This->stateBlock->baseVertexIndex = 0; 5328 5246 This->up_strided = DrawPrimStrideData; 5329 drawPrimitive(iface, vertex_count, 0 /* numindices */, 0 /* start_idx */, idxSize, pIndexData, 0 /* minindex */);5247 drawPrimitive(iface, 0 /* numindices */, 0 /* start_idx */, idxSize, pIndexData); 5330 5248 This->up_strided = NULL; 5331 5249 return WINED3D_OK; … … 5550 5468 int i; 5551 5469 5552 for (i = 0; i < MAX_COMBINED_SAMPLERS; i++) { 5553 IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i]; 5554 if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8 5555 || texture->resource.format_desc->format == WINED3DFMT_A8P8)) 5556 { 5557 IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i)); 5558 } 5559 } 5470 for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) 5471 { 5472 IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i]; 5473 if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8_UINT 5474 || texture->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)) 5475 { 5476 IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i)); 5477 } 5478 } 5560 5479 } 5561 5480 … … 5741 5660 const struct GlPixelFormatDesc *src_format_desc, *dst_format_desc; 5742 5661 GLenum dummy; 5743 intsampler;5662 DWORD sampler; 5744 5663 int bpp; 5745 5664 CONVERT_TYPES convert = NO_CONVERSION; … … 5881 5800 IWineD3DSurface_ModifyLocation(pDestinationSurface, SFLAG_INTEXTURE, TRUE); 5882 5801 sampler = This->rev_tex_unit_map[0]; 5883 if (sampler != -1) { 5802 if (sampler != WINED3D_UNMAPPED_STAGE) 5803 { 5884 5804 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(sampler)); 5885 5805 } … … 6034 5954 context = ActivateContext(This, surface, CTXUSAGE_RESOURCELOAD); 6035 5955 ENTER_GL(); 6036 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);5956 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 6037 5957 buffer = surface_get_gl_buffer(surface, swapchain); 6038 5958 glDrawBuffer(buffer); … … 6043 5963 context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 6044 5964 ENTER_GL(); 6045 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &context->dst_fbo);6046 context_attach_surface_fbo(context, GL_FRAMEBUFFER _EXT, 0, surface);6047 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER _EXT, NULL, FALSE);5965 context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo); 5966 context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, surface); 5967 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE); 6048 5968 } 6049 5969 … … 6086 6006 DWORD ret; 6087 6007 6088 if(destfmt == WINED3DFMT_A8R8G8B8 || destfmt == WINED3DFMT_X8R8G8B8 || 6089 destfmt == WINED3DFMT_R8G8B8) 6008 if (destfmt == WINED3DFMT_B8G8R8A8_UNORM 6009 || destfmt == WINED3DFMT_B8G8R8X8_UNORM 6010 || destfmt == WINED3DFMT_B8G8R8_UNORM) 6090 6011 return color; 6091 6012 … … 6099 6020 switch(destfmt) 6100 6021 { 6101 case WINED3DFMT_ R5G6B5:6022 case WINED3DFMT_B5G6R5_UNORM: 6102 6023 if(r == 0xff && g == 0xff && b == 0xff) return 0xffff; 6103 6024 r = (r * 32) / 256; … … 6110 6031 return ret; 6111 6032 6112 case WINED3DFMT_ X1R5G5B5:6113 case WINED3DFMT_ A1R5G5B5:6033 case WINED3DFMT_B5G5R5X1_UNORM: 6034 case WINED3DFMT_B5G5R5A1_UNORM: 6114 6035 a = (a * 2) / 256; 6115 6036 r = (r * 32) / 256; … … 6127 6048 return a; 6128 6049 6129 case WINED3DFMT_ X4R4G4B4:6130 case WINED3DFMT_ A4R4G4B4:6050 case WINED3DFMT_B4G4R4X4_UNORM: 6051 case WINED3DFMT_B4G4R4A4_UNORM: 6131 6052 a = (a * 16) / 256; 6132 6053 r = (r * 16) / 256; … … 6140 6061 return ret; 6141 6062 6142 case WINED3DFMT_ R3G3B2:6063 case WINED3DFMT_B2G3R3_UNORM: 6143 6064 r = (r * 8) / 256; 6144 6065 g = (g * 8) / 256; … … 6150 6071 return ret; 6151 6072 6152 case WINED3DFMT_ X8B8G8R8:6073 case WINED3DFMT_R8G8B8X8_UNORM: 6153 6074 case WINED3DFMT_R8G8B8A8_UNORM: 6154 6075 ret = a << 24; … … 6159 6080 return ret; 6160 6081 6161 case WINED3DFMT_ A2R10G10B10:6082 case WINED3DFMT_B10G10R10A2_UNORM: 6162 6083 a = (a * 4) / 256; 6163 6084 r = (r * 1024) / 256; … … 6402 6323 GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */ 6403 6324 IWineD3DSwapChain *src_swapchain, *dst_swapchain; 6325 const struct wined3d_gl_info *gl_info; 6404 6326 struct wined3d_context *context; 6405 6327 GLenum gl_filter; … … 6431 6353 else if (dst_swapchain) context = ActivateContext(This, dst_surface, CTXUSAGE_RESOURCELOAD); 6432 6354 else context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 6355 6356 gl_info = context->gl_info; 6433 6357 6434 6358 if (src_swapchain) { … … 6455 6379 6456 6380 ENTER_GL(); 6457 context_bind_fbo(context, GL_READ_FRAMEBUFFER _EXT, NULL);6381 context_bind_fbo(context, GL_READ_FRAMEBUFFER, NULL); 6458 6382 glReadBuffer(buffer); 6459 6383 checkGLcall("glReadBuffer()"); … … 6461 6385 TRACE("Source surface %p is offscreen\n", src_surface); 6462 6386 ENTER_GL(); 6463 context_bind_fbo(context, GL_READ_FRAMEBUFFER _EXT, &context->src_fbo);6464 context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER _EXT, 0, src_surface);6465 glReadBuffer(GL_COLOR_ATTACHMENT0 _EXT);6387 context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo); 6388 context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, src_surface); 6389 glReadBuffer(GL_COLOR_ATTACHMENT0); 6466 6390 checkGLcall("glReadBuffer()"); 6467 context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER _EXT, NULL, FALSE);6391 context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE); 6468 6392 } 6469 6393 LEAVE_GL(); … … 6494 6418 6495 6419 ENTER_GL(); 6496 context_bind_fbo(context, GL_DRAW_FRAMEBUFFER _EXT, NULL);6420 context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, NULL); 6497 6421 glDrawBuffer(buffer); 6498 6422 checkGLcall("glDrawBuffer()"); … … 6501 6425 6502 6426 ENTER_GL(); 6503 context_bind_fbo(context, GL_DRAW_FRAMEBUFFER _EXT, &context->dst_fbo);6504 context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER _EXT, 0, dst_surface);6505 glDrawBuffer(GL_COLOR_ATTACHMENT0 _EXT);6427 context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, &context->dst_fbo); 6428 context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, dst_surface); 6429 glDrawBuffer(GL_COLOR_ATTACHMENT0); 6506 6430 checkGLcall("glDrawBuffer()"); 6507 context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER _EXT, NULL, FALSE);6431 context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER, NULL, FALSE); 6508 6432 } 6509 6433 glDisable(GL_SCISSOR_TEST); … … 6511 6435 6512 6436 if (flip) { 6513 GL_EXTCALL(glBlitFramebufferEXT(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,6514 dst_rect->x1, dst_rect->y2, dst_rect->x2, dst_rect->y1, mask, gl_filter) );6437 gl_info->fbo_ops.glBlitFramebuffer(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2, 6438 dst_rect->x1, dst_rect->y2, dst_rect->x2, dst_rect->y1, mask, gl_filter); 6515 6439 checkGLcall("glBlitFramebuffer()"); 6516 6440 } else { 6517 GL_EXTCALL(glBlitFramebufferEXT(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2,6518 dst_rect->x1, dst_rect->y1, dst_rect->x2, dst_rect->y2, mask, gl_filter) );6441 gl_info->fbo_ops.glBlitFramebuffer(src_rect->x1, src_rect->y1, src_rect->x2, src_rect->y2, 6442 dst_rect->x1, dst_rect->y1, dst_rect->x2, dst_rect->y2, mask, gl_filter); 6519 6443 checkGLcall("glBlitFramebuffer()"); 6520 6444 } … … 6575 6499 viewport.MinZ = 0.0f; 6576 6500 IWineD3DDeviceImpl_SetViewport(iface, &viewport); 6577 /* Make sure the viewport state is dirty, because the render_offscreen thing affects it.6578 * SetViewport may catch NOP viewport changes, which would occur when switching between equally sized targets6579 */6580 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VIEWPORT);6581 6501 } 6582 6502 return WINED3D_OK; … … 6656 6576 6657 6577 /* MSDN: Cursor must be A8R8G8B8 */ 6658 if ( WINED3DFMT_A8R8G8B8 != pSur->resource.format_desc->format)6578 if (pSur->resource.format_desc->format != WINED3DFMT_B8G8R8A8_UNORM) 6659 6579 { 6660 6580 ERR("(%p) : surface(%p) has an invalid format\n", This, pCursorBitmap); … … 6682 6602 if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY))) 6683 6603 { 6684 const struct GlPixelFormatDesc *glDesc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &GLINFO_LOCATION); 6604 const struct GlPixelFormatDesc *glDesc = 6605 getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &GLINFO_LOCATION); 6685 6606 char *mem, *bits = rect.pBits; 6686 6607 GLint intfmt = glDesc->glInternal; … … 6690 6611 INT width = This->cursorWidth; 6691 6612 INT bpp = glDesc->byte_count; 6692 INT i, sampler; 6613 DWORD sampler; 6614 INT i; 6693 6615 6694 6616 /* Reformat the texture memory (pitch and width can be … … 6712 6634 checkGLcall("glActiveTextureARB"); 6713 6635 sampler = This->rev_tex_unit_map[0]; 6714 if (sampler != -1) { 6636 if (sampler != WINED3D_UNMAPPED_STAGE) 6637 { 6715 6638 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(sampler)); 6716 6639 } … … 6962 6885 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; 6963 6886 IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *) swapchain_iface; 6887 const struct wined3d_context *context; 6888 const struct wined3d_gl_info *gl_info; 6964 6889 UINT i; 6965 6890 IWineD3DBaseShaderImpl *shader; 6966 6891 6967 ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 6892 context = ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD); 6893 gl_info = context->gl_info; 6968 6894 6969 6895 IWineD3DDevice_EnumResources(iface, reset_unload_resources, NULL); … … 6978 6904 } 6979 6905 if (This->depth_blt_rb) { 6980 GL_EXTCALL(glDeleteRenderbuffersEXT(1, &This->depth_blt_rb));6906 gl_info->fbo_ops.glDeleteRenderbuffers(1, &This->depth_blt_rb); 6981 6907 This->depth_blt_rb = 0; 6982 6908 This->depth_blt_rb_w = 0; … … 7141 7067 IWineD3DDevice_SetDepthStencilSurface(iface, NULL); 7142 7068 7069 TRACE("Resetting stateblock\n"); 7070 IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock); 7071 IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock); 7072 7143 7073 delete_opengl_contexts(iface, (IWineD3DSwapChain *) swapchain); 7144 7074 … … 7214 7144 This->exStyle = exStyle; 7215 7145 } 7216 7217 TRACE("Resetting stateblock\n");7218 IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock);7219 IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock);7220 7146 7221 7147 /* Note: No parent needed for initial internal stateblock */ … … 7484 7410 IWineD3DDeviceImpl_SetGammaRamp, 7485 7411 IWineD3DDeviceImpl_GetGammaRamp, 7486 IWineD3DDeviceImpl_SetInd ices,7487 IWineD3DDeviceImpl_GetInd ices,7412 IWineD3DDeviceImpl_SetIndexBuffer, 7413 IWineD3DDeviceImpl_GetIndexBuffer, 7488 7414 IWineD3DDeviceImpl_SetBaseVertexIndex, 7489 7415 IWineD3DDeviceImpl_GetBaseVertexIndex, … … 7696 7622 UINT i; 7697 7623 7698 if(!rep) return;7699 7624 for(i = 0; i < This->numContexts; i++) { 7700 7625 context = This->contexts[i]; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/directx.c
r22496 r23571 7 7 * Copyright 2005 Oliver Stieber 8 8 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 9 * Copyright 2009 Henri Verbeet for CodeWeavers 9 10 * 10 11 * This library is free software; you can redistribute it and/or … … 66 67 {"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT, 0 }, 67 68 {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT, 0 }, 69 {"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP, 0 }, 68 70 {"GL_ARB_depth_texture", ARB_DEPTH_TEXTURE, 0 }, 69 71 {"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS, 0 }, 70 72 {"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM, 0 }, 71 73 {"GL_ARB_fragment_shader", ARB_FRAGMENT_SHADER, 0 }, 74 {"GL_ARB_framebuffer_object", ARB_FRAMEBUFFER_OBJECT, 0 }, 72 75 {"GL_ARB_geometry_shader4", ARB_GEOMETRY_SHADER4, 0 }, 73 76 {"GL_ARB_half_float_pixel", ARB_HALF_FLOAT_PIXEL, 0 }, … … 79 82 {"GL_ARB_point_parameters", ARB_POINT_PARAMETERS, 0 }, 80 83 {"GL_ARB_point_sprite", ARB_POINT_SPRITE, 0 }, 84 {"GL_ARB_provoking_vertex", ARB_PROVOKING_VERTEX, 0 }, 81 85 {"GL_ARB_texture_border_clamp", ARB_TEXTURE_BORDER_CLAMP, 0 }, 82 86 {"GL_ARB_texture_compression", ARB_TEXTURE_COMPRESSION, 0 }, … … 110 114 {"GL_EXT_paletted_texture", EXT_PALETTED_TEXTURE, 0 }, 111 115 {"GL_EXT_point_parameters", EXT_POINT_PARAMETERS, 0 }, 116 {"GL_EXT_provoking_vertex", EXT_PROVOKING_VERTEX, 0 }, 112 117 {"GL_EXT_secondary_color", EXT_SECONDARY_COLOR, 0 }, 113 118 {"GL_EXT_stencil_two_side", EXT_STENCIL_TWO_SIDE, 0 }, … … 194 199 }; 195 200 201 const struct min_lookup minMipLookup_noMip[] = 202 { 203 /* NONE POINT LINEAR */ 204 {{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* NONE */ 205 {{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* POINT */ 206 {{GL_LINEAR, GL_LINEAR, GL_LINEAR }}, /* LINEAR */ 207 }; 208 196 209 const GLenum magLookup[] = 197 210 { … … 376 389 } 377 390 378 /* Set the shader type for this device, depending on the given capabilities, 379 * the device type, and the user preferences in wined3d_settings */ 380 381 static void select_shader_mode(const struct wined3d_gl_info *gl_info, 382 WINED3DDEVTYPE DeviceType, int *ps_selected, int *vs_selected) 391 /* Set the shader type for this device, depending on the given capabilities 392 * and the user preferences in wined3d_settings. */ 393 static void select_shader_mode(const struct wined3d_gl_info *gl_info, int *ps_selected, int *vs_selected) 383 394 { 384 395 if (wined3d_settings.vs_mode == VS_NONE) { … … 388 399 * wrong. This combined with the fact that glsl won't offer more features or performance, use ARB 389 400 * shaders only on this card. */ 390 if (gl_info->vs_nv_version && gl_info->vs_nv_version < VS_VERSION_20)401 if (gl_info->supported[NV_VERTEX_PROGRAM] && !gl_info->supported[NV_VERTEX_PROGRAM2]) 391 402 *vs_selected = SHADER_ARB; 392 403 else … … 528 539 && gl_info->supported[APPLE_YCBCR_422]) 529 540 { 530 TRACE_(d3d_caps)("GL_APPLE_fence, GL_APPLE_client_storage, GL_APPLE_flush_render and GL_ycbcr_422 are supported.\n");531 TRACE_(d3d_caps)("Activating MacOS fixups.\n");532 541 return TRUE; 533 542 } 534 543 else 535 544 { 536 TRACE_(d3d_caps)("Apple extensions are not supported.\n");537 TRACE_(d3d_caps)("Not activating MacOS fixups.\n");538 545 return FALSE; 539 546 } … … 585 592 586 593 GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); 587 glFinish(); /* just to be sure */594 wglFinish(); /* just to be sure */ 588 595 589 596 memset(check, 0, sizeof(check)); … … 793 800 }; 794 801 795 st ruct driver_quirk quirk_table[] =802 static const struct driver_quirk quirk_table[] = 796 803 { 797 804 { … … 936 943 test_pbo_functionality(gl_info); 937 944 938 /* Fixup the driver version */ 945 /* Fixup the driver version we'll report to the app. */ 946 gl_info->driver_version = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */ 947 gl_info->driver_version_hipart = MAKEDWORD_VERSION(7, 1); 939 948 for (i = 0; i < (sizeof(driver_version_table) / sizeof(driver_version_table[0])); ++i) 940 949 { … … 953 962 } 954 963 } 964 TRACE_(d3d_caps)("Reporting (fake) driver version 0x%08X-0x%08X.\n", 965 gl_info->driver_version_hipart, gl_info->driver_version); 966 } 967 968 static DWORD wined3d_parse_gl_version(const char *gl_version) 969 { 970 const char *ptr = gl_version; 971 int major, minor; 972 973 major = atoi(ptr); 974 if (major <= 0) ERR_(d3d_caps)("Invalid opengl major version: %d.\n", major); 975 976 while (isdigit(*ptr)) ++ptr; 977 if (*ptr++ != '.') ERR_(d3d_caps)("Invalid opengl version string: %s.\n", debugstr_a(gl_version)); 978 979 minor = atoi(ptr); 980 981 TRACE_(d3d_caps)("Found OpenGL version: %d.%d.\n", major, minor); 982 983 return MAKEDWORD_VERSION(major, minor); 984 } 985 986 static GL_Vendors wined3d_guess_vendor(const char *gl_vendor, const char *gl_renderer) 987 { 988 if (strstr(gl_vendor, "NVIDIA")) 989 return VENDOR_NVIDIA; 990 991 if (strstr(gl_vendor, "ATI")) 992 return VENDOR_ATI; 993 994 if (strstr(gl_vendor, "Intel(R)") 995 || strstr(gl_renderer, "Intel(R)") 996 || strstr(gl_vendor, "Intel Inc.")) 997 return VENDOR_INTEL; 998 999 if (strstr(gl_vendor, "Mesa") 1000 || strstr(gl_vendor, "DRI R300 Project") 1001 || strstr(gl_vendor, "Tungsten Graphics, Inc")) 1002 return VENDOR_MESA; 1003 1004 FIXME_(d3d_caps)("Received unrecognized GL_VENDOR %s. Returning VENDOR_WINE.\n", debugstr_a(gl_vendor)); 1005 1006 return VENDOR_WINE; 1007 } 1008 1009 static GL_Cards wined3d_guess_card(const struct wined3d_gl_info *gl_info, const char *gl_renderer, 1010 GL_Vendors *vendor, unsigned int *vidmem) 1011 { 1012 /* Below is a list of Nvidia and ATI GPUs. Both vendors have dozens of 1013 * different GPUs with roughly the same features. In most cases GPUs from a 1014 * certain family differ in clockspeeds, the amount of video memory and the 1015 * number of shader pipelines. 1016 * 1017 * A Direct3D device object contains the PCI id (vendor + device) of the 1018 * videocard which is used for rendering. Various applications use this 1019 * information to get a rough estimation of the features of the card and 1020 * some might use it for enabling 3d effects only on certain types of 1021 * videocards. In some cases games might even use it to work around bugs 1022 * which happen on certain videocards/driver combinations. The problem is 1023 * that OpenGL only exposes a rendering string containing the name of the 1024 * videocard and not the PCI id. 1025 * 1026 * Various games depend on the PCI id, so somehow we need to provide one. 1027 * A simple option is to parse the renderer string and translate this to 1028 * the right PCI id. This is a lot of work because there are more than 200 1029 * GPUs just for Nvidia. Various cards share the same renderer string, so 1030 * the amount of code might be 'small' but there are quite a number of 1031 * exceptions which would make this a pain to maintain. Another way would 1032 * be to query the PCI id from the operating system (assuming this is the 1033 * videocard which is used for rendering which is not always the case). 1034 * This would work but it is not very portable. Second it would not work 1035 * well in, let's say, a remote X situation in which the amount of 3d 1036 * features which can be used is limited. 1037 * 1038 * As said most games only use the PCI id to get an indication of the 1039 * capabilities of the card. It doesn't really matter if the given id is 1040 * the correct one if we return the id of a card with similar 3d features. 1041 * 1042 * The code below checks the OpenGL capabilities of a videocard and matches 1043 * that to a certain level of Direct3D functionality. Once a card passes 1044 * the Direct3D9 check, we know that the card (in case of Nvidia) is at 1045 * least a GeforceFX. To give a better estimate we do a basic check on the 1046 * renderer string but if that won't pass we return a default card. This 1047 * way is better than maintaining a full card database as even without a 1048 * full database we can return a card with similar features. Second the 1049 * size of the database can be made quite small because when you know what 1050 * type of 3d functionality a card has, you know to which GPU family the 1051 * GPU must belong. Because of this you only have to check a small part of 1052 * the renderer string to distinguishes between different models from that 1053 * family. 1054 * 1055 * The code also selects a default amount of video memory which we will 1056 * use for an estimation of the amount of free texture memory. In case of 1057 * real D3D the amount of texture memory includes video memory and system 1058 * memory (to be specific AGP memory or in case of PCIE TurboCache / 1059 * HyperMemory). We don't know how much system memory can be addressed by 1060 * the system but we can make a reasonable estimation about the amount of 1061 * video memory. If the value is slightly wrong it doesn't matter as we 1062 * didn't include AGP-like memory which makes the amount of addressable 1063 * memory higher and second OpenGL isn't that critical it moves to system 1064 * memory behind our backs if really needed. Note that the amount of video 1065 * memory can be overruled using a registry setting. */ 1066 1067 switch (*vendor) 1068 { 1069 case VENDOR_NVIDIA: 1070 /* Both the GeforceFX, 6xxx and 7xxx series support D3D9. The last two types have more 1071 * shader capabilities, so we use the shader capabilities to distinguish between FX and 6xxx/7xxx. 1072 */ 1073 if (WINE_D3D9_CAPABLE(gl_info) && gl_info->supported[NV_VERTEX_PROGRAM3]) 1074 { 1075 /* Geforce 200 - highend */ 1076 if (strstr(gl_renderer, "GTX 280") 1077 || strstr(gl_renderer, "GTX 285") 1078 || strstr(gl_renderer, "GTX 295")) 1079 { 1080 *vidmem = 1024; 1081 return CARD_NVIDIA_GEFORCE_GTX280; 1082 } 1083 1084 /* Geforce 200 - midend high */ 1085 if (strstr(gl_renderer, "GTX 275")) 1086 { 1087 *vidmem = 896; 1088 return CARD_NVIDIA_GEFORCE_GTX275; 1089 } 1090 1091 /* Geforce 200 - midend */ 1092 if (strstr(gl_renderer, "GTX 260")) 1093 { 1094 *vidmem = 1024; 1095 return CARD_NVIDIA_GEFORCE_GTX260; 1096 } 1097 1098 /* Geforce9 - highend / Geforce 200 - midend (GTS 150/250 are based on the same core) */ 1099 if (strstr(gl_renderer, "9800") 1100 || strstr(gl_renderer, "GTS 150") 1101 || strstr(gl_renderer, "GTS 250")) 1102 { 1103 *vidmem = 512; 1104 return CARD_NVIDIA_GEFORCE_9800GT; 1105 } 1106 1107 /* Geforce9 - midend */ 1108 if (strstr(gl_renderer, "9600")) 1109 { 1110 *vidmem = 384; /* The 9600GSO has 384MB, the 9600GT has 512-1024MB */ 1111 return CARD_NVIDIA_GEFORCE_9600GT; 1112 } 1113 1114 /* Geforce9 - midend low / Geforce 200 - low */ 1115 if (strstr(gl_renderer, "9500") 1116 || strstr(gl_renderer, "GT 120") 1117 || strstr(gl_renderer, "GT 130")) 1118 { 1119 *vidmem = 256; /* The 9500GT has 256-1024MB */ 1120 return CARD_NVIDIA_GEFORCE_9500GT; 1121 } 1122 1123 /* Geforce9 - lowend */ 1124 if (strstr(gl_renderer, "9400")) 1125 { 1126 *vidmem = 256; /* The 9400GT has 256-1024MB */ 1127 return CARD_NVIDIA_GEFORCE_9400GT; 1128 } 1129 1130 /* Geforce9 - lowend low */ 1131 if (strstr(gl_renderer, "9100") 1132 || strstr(gl_renderer, "9200") 1133 || strstr(gl_renderer, "9300") 1134 || strstr(gl_renderer, "G 100")) 1135 { 1136 *vidmem = 256; /* The 9100-9300 cards have 256MB */ 1137 return CARD_NVIDIA_GEFORCE_9200; 1138 } 1139 1140 /* Geforce8 - highend */ 1141 if (strstr(gl_renderer, "8800")) 1142 { 1143 *vidmem = 320; /* The 8800GTS uses 320MB, a 8800GTX can have 768MB */ 1144 return CARD_NVIDIA_GEFORCE_8800GTS; 1145 } 1146 1147 /* Geforce8 - midend mobile */ 1148 if (strstr(gl_renderer, "8600 M")) 1149 { 1150 *vidmem = 512; 1151 return CARD_NVIDIA_GEFORCE_8600MGT; 1152 } 1153 1154 /* Geforce8 - midend */ 1155 if (strstr(gl_renderer, "8600") 1156 || strstr(gl_renderer, "8700")) 1157 { 1158 *vidmem = 256; 1159 return CARD_NVIDIA_GEFORCE_8600GT; 1160 } 1161 1162 /* Geforce8 - lowend */ 1163 if (strstr(gl_renderer, "8300") 1164 || strstr(gl_renderer, "8400") 1165 || strstr(gl_renderer, "8500")) 1166 { 1167 *vidmem = 128; /* 128-256MB for a 8300, 256-512MB for a 8400 */ 1168 return CARD_NVIDIA_GEFORCE_8300GS; 1169 } 1170 1171 /* Geforce7 - highend */ 1172 if (strstr(gl_renderer, "7800") 1173 || strstr(gl_renderer, "7900") 1174 || strstr(gl_renderer, "7950") 1175 || strstr(gl_renderer, "Quadro FX 4") 1176 || strstr(gl_renderer, "Quadro FX 5")) 1177 { 1178 *vidmem = 256; /* A 7800GT uses 256MB while highend 7900 cards can use 512MB */ 1179 return CARD_NVIDIA_GEFORCE_7800GT; 1180 } 1181 1182 /* Geforce7 midend */ 1183 if (strstr(gl_renderer, "7600") 1184 || strstr(gl_renderer, "7700")) 1185 { 1186 *vidmem = 256; /* The 7600 uses 256-512MB */ 1187 return CARD_NVIDIA_GEFORCE_7600; 1188 } 1189 1190 /* Geforce7 lower medium */ 1191 if (strstr(gl_renderer, "7400")) 1192 { 1193 *vidmem = 256; /* The 7400 uses 256-512MB */ 1194 return CARD_NVIDIA_GEFORCE_7400; 1195 } 1196 1197 /* Geforce7 lowend */ 1198 if (strstr(gl_renderer, "7300")) 1199 { 1200 *vidmem = 256; /* Mac Pros with this card have 256 MB */ 1201 return CARD_NVIDIA_GEFORCE_7300; 1202 } 1203 1204 /* Geforce6 highend */ 1205 if (strstr(gl_renderer, "6800")) 1206 { 1207 *vidmem = 128; /* The 6800 uses 128-256MB, the 7600 uses 256-512MB */ 1208 return CARD_NVIDIA_GEFORCE_6800; 1209 } 1210 1211 /* Geforce6 - midend */ 1212 if (strstr(gl_renderer, "6600") 1213 || strstr(gl_renderer, "6610") 1214 || strstr(gl_renderer, "6700")) 1215 { 1216 *vidmem = 128; /* A 6600GT has 128-256MB */ 1217 return CARD_NVIDIA_GEFORCE_6600GT; 1218 } 1219 1220 /* Geforce6/7 lowend */ 1221 *vidmem = 64; /* */ 1222 return CARD_NVIDIA_GEFORCE_6200; /* Geforce 6100/6150/6200/7300/7400/7500 */ 1223 } 1224 1225 if (WINE_D3D9_CAPABLE(gl_info)) 1226 { 1227 /* GeforceFX - highend */ 1228 if (strstr(gl_renderer, "5800") 1229 || strstr(gl_renderer, "5900") 1230 || strstr(gl_renderer, "5950") 1231 || strstr(gl_renderer, "Quadro FX")) 1232 { 1233 *vidmem = 256; /* 5800-5900 cards use 256MB */ 1234 return CARD_NVIDIA_GEFORCEFX_5800; 1235 } 1236 1237 /* GeforceFX - midend */ 1238 if (strstr(gl_renderer, "5600") 1239 || strstr(gl_renderer, "5650") 1240 || strstr(gl_renderer, "5700") 1241 || strstr(gl_renderer, "5750")) 1242 { 1243 *vidmem = 128; /* A 5600 uses 128-256MB */ 1244 return CARD_NVIDIA_GEFORCEFX_5600; 1245 } 1246 1247 /* GeforceFX - lowend */ 1248 *vidmem = 64; /* Normal FX5200 cards use 64-256MB; laptop (non-standard) can have less */ 1249 return CARD_NVIDIA_GEFORCEFX_5200; /* GeforceFX 5100/5200/5250/5300/5500 */ 1250 } 1251 1252 if (WINE_D3D8_CAPABLE(gl_info)) 1253 { 1254 if (strstr(gl_renderer, "GeForce4 Ti") || strstr(gl_renderer, "Quadro4")) 1255 { 1256 *vidmem = 64; /* Geforce4 Ti cards have 64-128MB */ 1257 return CARD_NVIDIA_GEFORCE4_TI4200; /* Geforce4 Ti4200/Ti4400/Ti4600/Ti4800, Quadro4 */ 1258 } 1259 1260 *vidmem = 64; /* Geforce3 cards have 64-128MB */ 1261 return CARD_NVIDIA_GEFORCE3; /* Geforce3 standard/Ti200/Ti500, Quadro DCC */ 1262 } 1263 1264 if (WINE_D3D7_CAPABLE(gl_info)) 1265 { 1266 if (strstr(gl_renderer, "GeForce4 MX")) 1267 { 1268 /* Most Geforce4MX GPUs have at least 64MB of memory, some 1269 * early models had 32MB but most have 64MB or even 128MB. */ 1270 *vidmem = 64; 1271 return CARD_NVIDIA_GEFORCE4_MX; /* MX420/MX440/MX460/MX4000 */ 1272 } 1273 1274 if (strstr(gl_renderer, "GeForce2 MX") || strstr(gl_renderer, "Quadro2 MXR")) 1275 { 1276 *vidmem = 32; /* Geforce2MX GPUs have 32-64MB of video memory */ 1277 return CARD_NVIDIA_GEFORCE2_MX; /* Geforce2 standard/MX100/MX200/MX400, Quadro2 MXR */ 1278 } 1279 1280 if (strstr(gl_renderer, "GeForce2") || strstr(gl_renderer, "Quadro2")) 1281 { 1282 *vidmem = 32; /* Geforce2 GPUs have 32-64MB of video memory */ 1283 return CARD_NVIDIA_GEFORCE2; /* Geforce2 GTS/Pro/Ti/Ultra, Quadro2 */ 1284 } 1285 1286 /* Most Geforce1 cards have 32MB, there are also some rare 16 1287 * and 64MB (Dell) models. */ 1288 *vidmem = 32; 1289 return CARD_NVIDIA_GEFORCE; /* Geforce 256/DDR, Quadro */ 1290 } 1291 1292 if (strstr(gl_renderer, "TNT2")) 1293 { 1294 *vidmem = 32; /* Most TNT2 boards have 32MB, though there are 16MB boards too */ 1295 return CARD_NVIDIA_RIVA_TNT2; /* Riva TNT2 standard/M64/Pro/Ultra */ 1296 } 1297 1298 *vidmem = 16; /* Most TNT boards have 16MB, some rare models have 8MB */ 1299 return CARD_NVIDIA_RIVA_TNT; /* Riva TNT, Vanta */ 1300 1301 case VENDOR_ATI: 1302 /* See http://developer.amd.com/drivers/pc_vendor_id/Pages/default.aspx 1303 * 1304 * Beware: renderer string do not match exact card model, 1305 * eg HD 4800 is returned for multiple cards, even for RV790 based ones. */ 1306 if (WINE_D3D9_CAPABLE(gl_info)) 1307 { 1308 /* Radeon R7xx HD4800 - highend */ 1309 if (strstr(gl_renderer, "HD 4800") /* Radeon RV7xx HD48xx generic renderer string */ 1310 || strstr(gl_renderer, "HD 4830") /* Radeon RV770 */ 1311 || strstr(gl_renderer, "HD 4850") /* Radeon RV770 */ 1312 || strstr(gl_renderer, "HD 4870") /* Radeon RV770 */ 1313 || strstr(gl_renderer, "HD 4890")) /* Radeon RV790 */ 1314 { 1315 *vidmem = 512; /* note: HD4890 cards use 1024MB */ 1316 return CARD_ATI_RADEON_HD4800; 1317 } 1318 1319 /* Radeon R740 HD4700 - midend */ 1320 if (strstr(gl_renderer, "HD 4700") /* Radeon RV770 */ 1321 || strstr(gl_renderer, "HD 4770")) /* Radeon RV740 */ 1322 { 1323 *vidmem = 512; 1324 return CARD_ATI_RADEON_HD4700; 1325 } 1326 1327 /* Radeon R730 HD4600 - midend */ 1328 if (strstr(gl_renderer, "HD 4600") /* Radeon RV730 */ 1329 || strstr(gl_renderer, "HD 4650") /* Radeon RV730 */ 1330 || strstr(gl_renderer, "HD 4670")) /* Radeon RV730 */ 1331 { 1332 *vidmem = 512; 1333 return CARD_ATI_RADEON_HD4600; 1334 } 1335 1336 /* Radeon R710 HD4500/HD4350 - lowend */ 1337 if (strstr(gl_renderer, "HD 4350") /* Radeon RV710 */ 1338 || strstr(gl_renderer, "HD 4550")) /* Radeon RV710 */ 1339 { 1340 *vidmem = 256; 1341 return CARD_ATI_RADEON_HD4350; 1342 } 1343 1344 /* Radeon R6xx HD2900/HD3800 - highend */ 1345 if (strstr(gl_renderer, "HD 2900") 1346 || strstr(gl_renderer, "HD 3870") 1347 || strstr(gl_renderer, "HD 3850")) 1348 { 1349 *vidmem = 512; /* HD2900/HD3800 uses 256-1024MB */ 1350 return CARD_ATI_RADEON_HD2900; 1351 } 1352 1353 /* Radeon R6xx HD2600/HD3600 - midend; HD3830 is China-only midend */ 1354 if (strstr(gl_renderer, "HD 2600") 1355 || strstr(gl_renderer, "HD 3830") 1356 || strstr(gl_renderer, "HD 3690") 1357 || strstr(gl_renderer, "HD 3650")) 1358 { 1359 *vidmem = 256; /* HD2600/HD3600 uses 256-512MB */ 1360 return CARD_ATI_RADEON_HD2600; 1361 } 1362 1363 /* Radeon R6xx HD2300/HD2400/HD3400 - lowend */ 1364 if (strstr(gl_renderer, "HD 2300") 1365 || strstr(gl_renderer, "HD 2400") 1366 || strstr(gl_renderer, "HD 3470") 1367 || strstr(gl_renderer, "HD 3450") 1368 || strstr(gl_renderer, "HD 3430") 1369 || strstr(gl_renderer, "HD 3400")) 1370 { 1371 *vidmem = 128; /* HD2300 uses at least 128MB, HD2400 uses 256MB */ 1372 return CARD_ATI_RADEON_HD2300; 1373 } 1374 1375 /* Radeon R6xx/R7xx integrated */ 1376 if (strstr(gl_renderer, "HD 3100") 1377 || strstr(gl_renderer, "HD 3200") 1378 || strstr(gl_renderer, "HD 3300")) 1379 { 1380 *vidmem = 128; /* 128MB */ 1381 return CARD_ATI_RADEON_HD3200; 1382 } 1383 1384 /* Radeon R5xx */ 1385 if (strstr(gl_renderer, "X1600") 1386 || strstr(gl_renderer, "X1650") 1387 || strstr(gl_renderer, "X1800") 1388 || strstr(gl_renderer, "X1900") 1389 || strstr(gl_renderer, "X1950")) 1390 { 1391 *vidmem = 128; /* X1600 uses 128-256MB, >=X1800 uses 256MB */ 1392 return CARD_ATI_RADEON_X1600; 1393 } 1394 1395 /* Radeon R4xx + X1300/X1400/X1450/X1550/X2300 (lowend R5xx) */ 1396 if (strstr(gl_renderer, "X700") 1397 || strstr(gl_renderer, "X800") 1398 || strstr(gl_renderer, "X850") 1399 || strstr(gl_renderer, "X1300") 1400 || strstr(gl_renderer, "X1400") 1401 || strstr(gl_renderer, "X1450") 1402 || strstr(gl_renderer, "X1550")) 1403 { 1404 *vidmem = 128; /* x700/x8*0 use 128-256MB, >=x1300 128-512MB */ 1405 return CARD_ATI_RADEON_X700; 1406 } 1407 1408 /* Radeon Xpress Series - onboard, DX9b, Shader 2.0, 300-400MHz */ 1409 if (strstr(gl_renderer, "Radeon Xpress")) 1410 { 1411 *vidmem = 64; /* Shared RAM, BIOS configurable, 64-256M */ 1412 return CARD_ATI_RADEON_XPRESS_200M; 1413 } 1414 1415 /* Radeon R3xx */ 1416 *vidmem = 64; /* Radeon 9500 uses 64MB, higher models use up to 256MB */ 1417 return CARD_ATI_RADEON_9500; /* Radeon 9500/9550/9600/9700/9800/X300/X550/X600 */ 1418 } 1419 1420 if (WINE_D3D8_CAPABLE(gl_info)) 1421 { 1422 *vidmem = 64; /* 8500/9000 cards use mostly 64MB, though there are 32MB and 128MB models */ 1423 return CARD_ATI_RADEON_8500; /* Radeon 8500/9000/9100/9200/9300 */ 1424 } 1425 1426 if (WINE_D3D7_CAPABLE(gl_info)) 1427 { 1428 *vidmem = 32; /* There are models with up to 64MB */ 1429 return CARD_ATI_RADEON_7200; /* Radeon 7000/7100/7200/7500 */ 1430 } 1431 1432 *vidmem = 16; /* There are 16-32MB models */ 1433 return CARD_ATI_RAGE_128PRO; 1434 1435 case VENDOR_INTEL: 1436 if (strstr(gl_renderer, "X3100")) 1437 { 1438 /* MacOS calls the card GMA X3100, Google findings also suggest the name GM965 */ 1439 *vidmem = 128; 1440 return CARD_INTEL_X3100; 1441 } 1442 1443 if (strstr(gl_renderer, "GMA 950") || strstr(gl_renderer, "945GM")) 1444 { 1445 /* MacOS calls the card GMA 950, but everywhere else the PCI ID is named 945GM */ 1446 *vidmem = 64; 1447 return CARD_INTEL_I945GM; 1448 } 1449 1450 if (strstr(gl_renderer, "915GM")) return CARD_INTEL_I915GM; 1451 if (strstr(gl_renderer, "915G")) return CARD_INTEL_I915G; 1452 if (strstr(gl_renderer, "865G")) return CARD_INTEL_I865G; 1453 if (strstr(gl_renderer, "855G")) return CARD_INTEL_I855G; 1454 if (strstr(gl_renderer, "830G")) return CARD_INTEL_I830G; 1455 return CARD_INTEL_I915G; 1456 1457 case VENDOR_MESA: 1458 case VENDOR_WINE: 1459 default: 1460 /* Default to generic Nvidia hardware based on the supported OpenGL extensions. The choice 1461 * for Nvidia was because the hardware and drivers they make are of good quality. This makes 1462 * them a good generic choice. */ 1463 *vendor = VENDOR_NVIDIA; 1464 if (WINE_D3D9_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCEFX_5600; 1465 if (WINE_D3D8_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE3; 1466 if (WINE_D3D7_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE; 1467 if (WINE_D3D6_CAPABLE(gl_info)) return CARD_NVIDIA_RIVA_TNT; 1468 return CARD_NVIDIA_RIVA_128; 1469 } 955 1470 } 956 1471 … … 961 1476 const char *WGL_Extensions = NULL; 962 1477 const char *gl_string = NULL; 963 const char *gl_string_cursor = NULL;964 1478 GLint gl_max; 965 1479 GLfloat gl_floatv[2]; 966 int major = 1, minor = 0;967 1480 unsigned i; 968 1481 HDC hdc; … … 977 1490 978 1491 gl_string = (const char *)glGetString(GL_RENDERER); 979 TRACE_(d3d_caps)("GL_RENDERER: %s.\n", gl_string);1492 TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_string)); 980 1493 if (!gl_string) 981 1494 { 1495 LEAVE_GL(); 982 1496 ERR_(d3d_caps)("Received a NULL GL_RENDERER.\n"); 983 1497 return FALSE; … … 988 1502 if (!gl_renderer) 989 1503 { 1504 LEAVE_GL(); 990 1505 ERR_(d3d_caps)("Failed to allocate gl_renderer memory.\n"); 991 1506 return FALSE; … … 994 1509 995 1510 gl_string = (const char *)glGetString(GL_VENDOR); 996 TRACE_(d3d_caps)("GL_VENDOR: %s.\n", gl_string);1511 TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_string)); 997 1512 if (!gl_string) 998 1513 { 1514 LEAVE_GL(); 999 1515 ERR_(d3d_caps)("Received a NULL GL_VENDOR.\n"); 1000 1516 HeapFree(GetProcessHeap(), 0, gl_renderer); 1001 1517 return FALSE; 1002 1518 } 1003 1004 /* Fill in the GL vendor */ 1005 if (strstr(gl_string, "NVIDIA")) 1006 { 1007 gl_info->gl_vendor = VENDOR_NVIDIA; 1008 } 1009 else if (strstr(gl_string, "ATI")) 1010 { 1011 gl_info->gl_vendor = VENDOR_ATI; 1012 } 1013 else if (strstr(gl_string, "Intel(R)") 1014 || strstr(gl_renderer, "Intel(R)") 1015 || strstr(gl_string, "Intel Inc.")) 1016 { 1017 gl_info->gl_vendor = VENDOR_INTEL; 1018 } 1019 else if (strstr(gl_string, "Mesa")) 1020 { 1021 gl_info->gl_vendor = VENDOR_MESA; 1022 } 1023 else 1024 { 1025 FIXME_(d3d_caps)("Received unrecognized GL_VENDOR %s. Setting VENDOR_WINE.\n", gl_string); 1026 gl_info->gl_vendor = VENDOR_WINE; 1027 } 1519 gl_info->gl_vendor = wined3d_guess_vendor(gl_string, gl_renderer); 1028 1520 TRACE_(d3d_caps)("found GL_VENDOR (%s)->(0x%04x)\n", debugstr_a(gl_string), gl_info->gl_vendor); 1029 1521 1030 1522 /* Parse the GL_VERSION field into major and minor information */ 1031 1523 gl_string = (const char *)glGetString(GL_VERSION); 1032 TRACE_(d3d_caps)("GL_VERSION: %s.\n", gl_string);1524 TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_string)); 1033 1525 if (!gl_string) 1034 1526 { 1527 LEAVE_GL(); 1035 1528 ERR_(d3d_caps)("Received a NULL GL_VERSION.\n"); 1036 1529 HeapFree(GetProcessHeap(), 0, gl_renderer); 1037 1530 return FALSE; 1038 1531 } 1039 1040 /* First, parse the generic opengl version. This is supposed not to be 1041 * convoluted with driver specific information. */ 1042 gl_string_cursor = gl_string; 1043 1044 major = atoi(gl_string_cursor); 1045 if (major <= 0) ERR_(d3d_caps)("Invalid opengl major version: %d.\n", major); 1046 while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') ++gl_string_cursor; 1047 if (*gl_string_cursor++ != '.') ERR_(d3d_caps)("Invalid opengl version string: %s.\n", debugstr_a(gl_string)); 1048 1049 minor = atoi(gl_string_cursor); 1050 TRACE_(d3d_caps)("Found OpenGL version: %d.%d.\n", major, minor); 1051 gl_version = MAKEDWORD_VERSION(major, minor); 1052 1053 /* Now parse the driver specific string which we'll report to the app. */ 1054 switch (gl_info->gl_vendor) 1055 { 1056 case VENDOR_NVIDIA: 1057 gl_string_cursor = strstr(gl_string, "NVIDIA"); 1058 if (!gl_string_cursor) 1059 { 1060 ERR_(d3d_caps)("Invalid nVidia version string: %s.\n", debugstr_a(gl_string)); 1061 break; 1062 } 1063 1064 gl_string_cursor = strstr(gl_string_cursor, " "); 1065 if (!gl_string_cursor) 1066 { 1067 ERR_(d3d_caps)("Invalid nVidia version string: %s.\n", debugstr_a(gl_string)); 1068 break; 1069 } 1070 1071 while (*gl_string_cursor == ' ') ++gl_string_cursor; 1072 1073 if (!*gl_string_cursor) 1074 { 1075 ERR_(d3d_caps)("Invalid nVidia version string: %s.\n", debugstr_a(gl_string)); 1076 break; 1077 } 1078 1079 major = atoi(gl_string_cursor); 1080 while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') ++gl_string_cursor; 1081 1082 if (*gl_string_cursor++ != '.') 1083 { 1084 ERR_(d3d_caps)("Invalid nVidia version string: %s.\n", debugstr_a(gl_string)); 1085 break; 1086 } 1087 1088 minor = atoi(gl_string_cursor); 1089 minor = major * 100 + minor; 1090 major = 10; 1091 break; 1092 1093 case VENDOR_ATI: 1094 major = minor = 0; 1095 gl_string_cursor = strchr(gl_string, '-'); 1096 if (gl_string_cursor) 1097 { 1098 ++gl_string_cursor; 1099 1100 /* Check if version number is of the form x.y.z. */ 1101 if (*gl_string_cursor < '0' || *gl_string_cursor > '9' 1102 || gl_string_cursor[1] != '.' 1103 || gl_string_cursor[2] < '0' || gl_string_cursor[2] > '9' 1104 || gl_string_cursor[3] != '.' 1105 || gl_string_cursor[4] < '0' || gl_string_cursor[4] > '9') 1106 /* Mark version number as malformed. */ 1107 gl_string_cursor = 0; 1108 } 1109 1110 if (!gl_string_cursor) 1111 { 1112 WARN_(d3d_caps)("malformed GL_VERSION (%s).\n", debugstr_a(gl_string)); 1113 } 1114 else 1115 { 1116 major = *gl_string_cursor - '0'; 1117 minor = (gl_string_cursor[2] - '0') * 256 + (gl_string_cursor[4] - '0'); 1118 } 1119 break; 1120 1121 case VENDOR_INTEL: 1122 /* Apple and Mesa version strings look differently, but both provide intel drivers. */ 1123 if (strstr(gl_string, "APPLE")) 1124 { 1125 /* [0-9]+.[0-9]+ APPLE-[0-9]+.[0.9]+.[0.9]+ 1126 * We only need the first part, and use the APPLE as identification 1127 * "1.2 APPLE-1.4.56". */ 1128 gl_string_cursor = gl_string; 1129 major = atoi(gl_string_cursor); 1130 while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') ++gl_string_cursor; 1131 1132 if (*gl_string_cursor++ != '.') 1133 { 1134 ERR_(d3d_caps)("Invalid MacOS-Intel version string: %s.\n", debugstr_a(gl_string)); 1135 break; 1136 } 1137 1138 minor = atoi(gl_string_cursor); 1139 break; 1140 } 1141 /* Fallthrough */ 1142 1143 case VENDOR_MESA: 1144 gl_string_cursor = strstr(gl_string, "Mesa"); 1145 gl_string_cursor = strstr(gl_string_cursor, " "); 1146 while (*gl_string_cursor && ' ' == *gl_string_cursor) ++gl_string_cursor; 1147 if (*gl_string_cursor) 1148 { 1149 char tmp[16]; 1150 int cursor = 0; 1151 1152 while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') 1153 { 1154 tmp[cursor++] = *gl_string_cursor; 1155 ++gl_string_cursor; 1156 } 1157 tmp[cursor] = 0; 1158 major = atoi(tmp); 1159 1160 if (*gl_string_cursor != '.') WARN_(d3d_caps)("malformed GL_VERSION (%s).\n", debugstr_a(gl_string)); 1161 ++gl_string_cursor; 1162 1163 cursor = 0; 1164 while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') 1165 { 1166 tmp[cursor++] = *gl_string_cursor; 1167 ++gl_string_cursor; 1168 } 1169 tmp[cursor] = 0; 1170 minor = atoi(tmp); 1171 } 1172 break; 1173 1174 default: 1175 major = 0; 1176 minor = 9; 1177 break; 1178 } 1179 1180 gl_info->driver_version = MAKEDWORD_VERSION(major, minor); 1181 TRACE_(d3d_caps)("found driver version (%s)->%i.%i->(0x%08x).\n", 1182 debugstr_a(gl_string), major, minor, gl_info->driver_version); 1183 /* Current Windows drivers have versions like 6.14.... (some older have an earlier version). */ 1184 gl_info->driver_version_hipart = MAKEDWORD_VERSION(6, 14); 1532 gl_version = wined3d_parse_gl_version(gl_string); 1185 1533 1186 1534 /* … … 1196 1544 gl_info->max_combined_samplers = gl_info->max_fragment_samplers + gl_info->max_vertex_samplers; 1197 1545 gl_info->max_sampler_stages = 1; 1198 gl_info->ps_arb_version = PS_VERSION_NOT_SUPPORTED;1199 1546 gl_info->ps_arb_max_temps = 0; 1200 1547 gl_info->ps_arb_max_instructions = 0; 1201 gl_info->vs_arb_version = VS_VERSION_NOT_SUPPORTED;1202 1548 gl_info->vs_arb_max_temps = 0; 1203 1549 gl_info->vs_arb_max_instructions = 0; 1204 gl_info->vs_nv_version = VS_VERSION_NOT_SUPPORTED;1205 gl_info->vs_ati_version = VS_VERSION_NOT_SUPPORTED;1206 1550 gl_info->vs_glsl_constantsF = 0; 1207 1551 gl_info->ps_glsl_constantsF = 0; … … 1232 1576 if (!GL_Extensions) 1233 1577 { 1578 LEAVE_GL(); 1234 1579 ERR_(d3d_caps)("Received a NULL GL_EXTENSIONS.\n"); 1235 1580 HeapFree(GetProcessHeap(), 0, gl_renderer); … … 1237 1582 } 1238 1583 1584 LEAVE_GL(); 1585 1239 1586 TRACE_(d3d_caps)("GL_Extensions reported:\n"); 1240 1587 … … 1255 1602 memcpy(current_ext, start, len); 1256 1603 current_ext[len] = '\0'; 1257 TRACE_(d3d_caps)("- %s\n", current_ext);1604 TRACE_(d3d_caps)("- %s\n", debugstr_a(current_ext)); 1258 1605 1259 1606 for (i = 0; i < (sizeof(EXTENSION_MAP) / sizeof(*EXTENSION_MAP)); ++i) … … 1267 1614 } 1268 1615 } 1269 1270 LEAVE_GL();1271 1616 1272 1617 /* Now work out what GL support this card really has */ … … 1334 1679 TRACE_(d3d_caps)(" IMPLIED: NVIDIA (NV) Texture Gen Reflection support.\n"); 1335 1680 gl_info->supported[NV_TEXGEN_REFLECTION] = TRUE; 1681 } 1682 if (!gl_info->supported[ARB_DEPTH_CLAMP] && gl_info->supported[NV_DEPTH_CLAMP]) 1683 { 1684 TRACE_(d3d_caps)(" IMPLIED: ARB_depth_clamp support (by NV_depth_clamp).\n"); 1685 gl_info->supported[ARB_DEPTH_CLAMP] = TRUE; 1336 1686 } 1337 1687 if (gl_info->supported[NV_TEXTURE_SHADER2]) … … 1442 1792 if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) 1443 1793 { 1444 gl_info->ps_arb_version = PS_VERSION_11;1445 1794 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)); 1446 1795 gl_info->ps_arb_constantsF = gl_max; … … 1452 1801 gl_info->ps_arb_max_instructions = gl_max; 1453 1802 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native instructions: %d.\n", gl_info->ps_arb_max_instructions); 1803 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &gl_max)); 1804 gl_info->ps_arb_max_local_constants = gl_max; 1805 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM local parameters: %d.\n", gl_info->ps_arb_max_instructions); 1454 1806 } 1455 1807 if (gl_info->supported[ARB_VERTEX_PROGRAM]) 1456 1808 { 1457 gl_info->vs_arb_version = VS_VERSION_11;1458 1809 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)); 1459 1810 gl_info->vs_arb_constantsF = gl_max; … … 1482 1833 gl_info->max_glsl_varyings = gl_max; 1483 1834 TRACE_(d3d_caps)("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4); 1484 }1485 if (gl_info->supported[EXT_VERTEX_SHADER])1486 {1487 gl_info->vs_ati_version = VS_VERSION_11;1488 }1489 if (gl_info->supported[NV_VERTEX_PROGRAM3])1490 {1491 gl_info->vs_nv_version = VS_VERSION_30;1492 }1493 else if (gl_info->supported[NV_VERTEX_PROGRAM2])1494 {1495 gl_info->vs_nv_version = VS_VERSION_20;1496 }1497 else if (gl_info->supported[NV_VERTEX_PROGRAM1_1])1498 {1499 gl_info->vs_nv_version = VS_VERSION_11;1500 }1501 else if (gl_info->supported[NV_VERTEX_PROGRAM])1502 {1503 gl_info->vs_nv_version = VS_VERSION_10;1504 }1505 if (gl_info->supported[NV_FRAGMENT_PROGRAM2])1506 {1507 gl_info->ps_nv_version = PS_VERSION_30;1508 }1509 else if (gl_info->supported[NV_FRAGMENT_PROGRAM])1510 {1511 gl_info->ps_nv_version = PS_VERSION_20;1512 1835 } 1513 1836 if (gl_info->supported[NV_LIGHT_MAX_EXPONENT]) … … 1554 1877 checkGLcall("extension detection"); 1555 1878 1879 LEAVE_GL(); 1880 1556 1881 /* In some cases the number of texture stages can be larger than the number 1557 1882 * of samplers. The GF4 for example can use only 2 samplers (no fragment … … 1559 1884 gl_info->max_sampler_stages = max(gl_info->max_fragment_samplers, gl_info->max_texture_stages); 1560 1885 1561 /* We can only use ORM_FBO when the hardware supports it. */ 1562 if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) { 1563 WARN_(d3d_caps)("GL_EXT_framebuffer_object not supported, falling back to backbuffer offscreen rendering mode.\n"); 1564 wined3d_settings.offscreen_rendering_mode = ORM_BACKBUFFER; 1886 if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]) 1887 { 1888 gl_info->fbo_ops.glIsRenderbuffer = gl_info->glIsRenderbuffer; 1889 gl_info->fbo_ops.glBindRenderbuffer = gl_info->glBindRenderbuffer; 1890 gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->glDeleteRenderbuffers; 1891 gl_info->fbo_ops.glGenRenderbuffers = gl_info->glGenRenderbuffers; 1892 gl_info->fbo_ops.glRenderbufferStorage = gl_info->glRenderbufferStorage; 1893 gl_info->fbo_ops.glRenderbufferStorageMultisample = gl_info->glRenderbufferStorageMultisample; 1894 gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->glGetRenderbufferParameteriv; 1895 gl_info->fbo_ops.glIsFramebuffer = gl_info->glIsFramebuffer; 1896 gl_info->fbo_ops.glBindFramebuffer = gl_info->glBindFramebuffer; 1897 gl_info->fbo_ops.glDeleteFramebuffers = gl_info->glDeleteFramebuffers; 1898 gl_info->fbo_ops.glGenFramebuffers = gl_info->glGenFramebuffers; 1899 gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->glCheckFramebufferStatus; 1900 gl_info->fbo_ops.glFramebufferTexture1D = gl_info->glFramebufferTexture1D; 1901 gl_info->fbo_ops.glFramebufferTexture2D = gl_info->glFramebufferTexture2D; 1902 gl_info->fbo_ops.glFramebufferTexture3D = gl_info->glFramebufferTexture3D; 1903 gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->glFramebufferRenderbuffer; 1904 gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv = gl_info->glGetFramebufferAttachmentParameteriv; 1905 gl_info->fbo_ops.glBlitFramebuffer = gl_info->glBlitFramebuffer; 1906 gl_info->fbo_ops.glGenerateMipmap = gl_info->glGenerateMipmap; 1907 } 1908 else 1909 { 1910 if (gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) 1911 { 1912 gl_info->fbo_ops.glIsRenderbuffer = gl_info->glIsRenderbufferEXT; 1913 gl_info->fbo_ops.glBindRenderbuffer = gl_info->glBindRenderbufferEXT; 1914 gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->glDeleteRenderbuffersEXT; 1915 gl_info->fbo_ops.glGenRenderbuffers = gl_info->glGenRenderbuffersEXT; 1916 gl_info->fbo_ops.glRenderbufferStorage = gl_info->glRenderbufferStorageEXT; 1917 gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->glGetRenderbufferParameterivEXT; 1918 gl_info->fbo_ops.glIsFramebuffer = gl_info->glIsFramebufferEXT; 1919 gl_info->fbo_ops.glBindFramebuffer = gl_info->glBindFramebufferEXT; 1920 gl_info->fbo_ops.glDeleteFramebuffers = gl_info->glDeleteFramebuffersEXT; 1921 gl_info->fbo_ops.glGenFramebuffers = gl_info->glGenFramebuffersEXT; 1922 gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->glCheckFramebufferStatusEXT; 1923 gl_info->fbo_ops.glFramebufferTexture1D = gl_info->glFramebufferTexture1DEXT; 1924 gl_info->fbo_ops.glFramebufferTexture2D = gl_info->glFramebufferTexture2DEXT; 1925 gl_info->fbo_ops.glFramebufferTexture3D = gl_info->glFramebufferTexture3DEXT; 1926 gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->glFramebufferRenderbufferEXT; 1927 gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv = gl_info->glGetFramebufferAttachmentParameterivEXT; 1928 gl_info->fbo_ops.glGenerateMipmap = gl_info->glGenerateMipmapEXT; 1929 } 1930 else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) 1931 { 1932 WARN_(d3d_caps)("Framebuffer objects not supported, falling back to backbuffer offscreen rendering mode.\n"); 1933 wined3d_settings.offscreen_rendering_mode = ORM_BACKBUFFER; 1934 } 1935 if (gl_info->supported[EXT_FRAMEBUFFER_BLIT]) 1936 { 1937 gl_info->fbo_ops.glBlitFramebuffer = gl_info->glBlitFramebufferEXT; 1938 } 1939 if (gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE]) 1940 { 1941 gl_info->fbo_ops.glRenderbufferStorageMultisample = gl_info->glRenderbufferStorageMultisampleEXT; 1942 } 1565 1943 } 1566 1944 … … 1570 1948 } 1571 1949 1572 /* Below is a list of Nvidia and ATI GPUs. Both vendors have dozens of different GPUs with roughly the same 1573 * features. In most cases GPUs from a certain family differ in clockspeeds, the amount of video memory and 1574 * in case of the latest videocards in the number of pixel/vertex pipelines. 1575 * 1576 * A Direct3D device object contains the PCI id (vendor + device) of the videocard which is used for 1577 * rendering. Various games use this information to get a rough estimation of the features of the card 1578 * and some might use it for enabling 3d effects only on certain types of videocards. In some cases 1579 * games might even use it to work around bugs which happen on certain videocards/driver combinations. 1580 * The problem is that OpenGL only exposes a rendering string containing the name of the videocard and 1581 * not the PCI id. 1582 * 1583 * Various games depend on the PCI id, so somehow we need to provide one. A simple option is to parse 1584 * the renderer string and translate this to the right PCI id. This is a lot of work because there are more 1585 * than 200 GPUs just for Nvidia. Various cards share the same renderer string, so the amount of code might 1586 * be 'small' but there are quite a number of exceptions which would make this a pain to maintain. 1587 * Another way would be to query the PCI id from the operating system (assuming this is the videocard which 1588 * is used for rendering which is not always the case). This would work but it is not very portable. Second 1589 * it would not work well in, let's say, a remote X situation in which the amount of 3d features which can be used 1590 * is limited. 1591 * 1592 * As said most games only use the PCI id to get an indication of the capabilities of the card. 1593 * It doesn't really matter if the given id is the correct one if we return the id of a card with 1594 * similar 3d features. 1595 * 1596 * The code below checks the OpenGL capabilities of a videocard and matches that to a certain level of 1597 * Direct3D functionality. Once a card passes the Direct3D9 check, we know that the card (in case of Nvidia) 1598 * is at least a GeforceFX. To give a better estimate we do a basic check on the renderer string but if that 1599 * won't pass we return a default card. This way is better than maintaining a full card database as even 1600 * without a full database we can return a card with similar features. Second the size of the database 1601 * can be made quite small because when you know what type of 3d functionality a card has, you know to which 1602 * GPU family the GPU must belong. Because of this you only have to check a small part of the renderer string 1603 * to distinguishes between different models from that family. 1604 * 1605 * The code also selects a default amount of video memory which we will use for an estimation of the amount 1606 * of free texture memory. In case of real D3D the amount of texture memory includes video memory and system 1607 * memory (to be specific AGP memory or in case of PCIE TurboCache/HyperMemory). We don't know how much 1608 * system memory can be addressed by the system but we can make a reasonable estimation about the amount of 1609 * video memory. If the value is slightly wrong it doesn't matter as we didn't include AGP-like memory which 1610 * makes the amount of addressable memory higher and second OpenGL isn't that critical it moves to system 1611 * memory behind our backs if really needed. 1612 * Note that the amount of video memory can be overruled using a registry setting. 1613 */ 1614 switch (gl_info->gl_vendor) { 1615 case VENDOR_NVIDIA: 1616 /* Both the GeforceFX, 6xxx and 7xxx series support D3D9. The last two types have more 1617 * shader capabilities, so we use the shader capabilities to distinguish between FX and 6xxx/7xxx. 1618 */ 1619 if(WINE_D3D9_CAPABLE(gl_info) && (gl_info->vs_nv_version == VS_VERSION_30)) { 1620 /* Geforce 200 - highend */ 1621 if (strstr(gl_renderer, "GTX 280") 1622 || strstr(gl_renderer, "GTX 285") 1623 || strstr(gl_renderer, "GTX 295")) 1624 { 1625 gl_info->gl_card = CARD_NVIDIA_GEFORCE_GTX280; 1626 vidmem = 1024; 1627 } 1628 /* Geforce 200 - midend high */ 1629 else if (strstr(gl_renderer, "GTX 275")) 1630 { 1631 gl_info->gl_card = CARD_NVIDIA_GEFORCE_GTX275; 1632 vidmem = 896; 1633 } 1634 /* Geforce 200 - midend */ 1635 else if (strstr(gl_renderer, "GTX 260")) 1636 { 1637 gl_info->gl_card = CARD_NVIDIA_GEFORCE_GTX260; 1638 vidmem = 1024; 1639 } 1640 /* Geforce9 - highend / Geforce 200 - midend (GTS 150/250 are based on the same core) */ 1641 else if (strstr(gl_renderer, "9800") 1642 || strstr(gl_renderer, "GTS 150") 1643 || strstr(gl_renderer, "GTS 250")) 1644 { 1645 gl_info->gl_card = CARD_NVIDIA_GEFORCE_9800GT; 1646 vidmem = 512; 1647 } 1648 /* Geforce9 - midend */ 1649 else if (strstr(gl_renderer, "9600")) 1650 { 1651 gl_info->gl_card = CARD_NVIDIA_GEFORCE_9600GT; 1652 vidmem = 384; /* The 9600GSO has 384MB, the 9600GT has 512-1024MB */ 1653 } 1654 /* Geforce9 - midend low / Geforce 200 - low*/ 1655 else if (strstr(gl_renderer, "9500") 1656 || strstr(gl_renderer, "GT 120") 1657 || strstr(gl_renderer, "GT 130")) 1658 { 1659 gl_info->gl_card = CARD_NVIDIA_GEFORCE_9500GT; 1660 vidmem = 256; /* The 9500GT has 256-1024MB */ 1661 } 1662 /* Geforce9 - lowend */ 1663 else if (strstr(gl_renderer, "9400")) 1664 { 1665 gl_info->gl_card = CARD_NVIDIA_GEFORCE_9400GT; 1666 vidmem = 256; /* The 9400GT has 256-1024MB */ 1667 } 1668 /* Geforce9 - lowend low */ 1669 else if (strstr(gl_renderer, "9100") 1670 || strstr(gl_renderer, "9200") 1671 || strstr(gl_renderer, "9300") 1672 || strstr(gl_renderer, "G 100")) 1673 { 1674 gl_info->gl_card = CARD_NVIDIA_GEFORCE_9200; 1675 vidmem = 256; /* The 9100-9300 cards have 256MB */ 1676 } 1677 /* Geforce8 - highend */ 1678 else if (strstr(gl_renderer, "8800")) 1679 { 1680 gl_info->gl_card = CARD_NVIDIA_GEFORCE_8800GTS; 1681 vidmem = 320; /* The 8800GTS uses 320MB, a 8800GTX can have 768MB */ 1682 } 1683 /* Geforce8 - midend mobile */ 1684 else if (strstr(gl_renderer, "8600 M")) 1685 { 1686 gl_info->gl_card = CARD_NVIDIA_GEFORCE_8600MGT; 1687 vidmem = 512; 1688 } 1689 /* Geforce8 - midend */ 1690 else if (strstr(gl_renderer, "8600") 1691 || strstr(gl_renderer, "8700")) 1692 { 1693 gl_info->gl_card = CARD_NVIDIA_GEFORCE_8600GT; 1694 vidmem = 256; 1695 } 1696 /* Geforce8 - lowend */ 1697 else if (strstr(gl_renderer, "8300") 1698 || strstr(gl_renderer, "8400") 1699 || strstr(gl_renderer, "8500")) 1700 { 1701 gl_info->gl_card = CARD_NVIDIA_GEFORCE_8300GS; 1702 vidmem = 128; /* 128-256MB for a 8300, 256-512MB for a 8400 */ 1703 } 1704 /* Geforce7 - highend */ 1705 else if (strstr(gl_renderer, "7800") 1706 || strstr(gl_renderer, "7900") 1707 || strstr(gl_renderer, "7950") 1708 || strstr(gl_renderer, "Quadro FX 4") 1709 || strstr(gl_renderer, "Quadro FX 5")) 1710 { 1711 gl_info->gl_card = CARD_NVIDIA_GEFORCE_7800GT; 1712 vidmem = 256; /* A 7800GT uses 256MB while highend 7900 cards can use 512MB */ 1713 } 1714 /* Geforce7 midend */ 1715 else if (strstr(gl_renderer, "7600") 1716 || strstr(gl_renderer, "7700")) 1717 { 1718 gl_info->gl_card = CARD_NVIDIA_GEFORCE_7600; 1719 vidmem = 256; /* The 7600 uses 256-512MB */ 1720 /* Geforce7 lower medium */ 1721 } 1722 else if (strstr(gl_renderer, "7400")) 1723 { 1724 gl_info->gl_card = CARD_NVIDIA_GEFORCE_7400; 1725 vidmem = 256; /* The 7400 uses 256-512MB */ 1726 } 1727 /* Geforce7 lowend */ 1728 else if (strstr(gl_renderer, "7300")) 1729 { 1730 gl_info->gl_card = CARD_NVIDIA_GEFORCE_7300; 1731 vidmem = 256; /* Mac Pros with this card have 256 MB */ 1732 } 1733 /* Geforce6 highend */ 1734 else if (strstr(gl_renderer, "6800")) 1735 { 1736 gl_info->gl_card = CARD_NVIDIA_GEFORCE_6800; 1737 vidmem = 128; /* The 6800 uses 128-256MB, the 7600 uses 256-512MB */ 1738 } 1739 /* Geforce6 - midend */ 1740 else if (strstr(gl_renderer, "6600") 1741 || strstr(gl_renderer, "6610") 1742 || strstr(gl_renderer, "6700")) 1743 { 1744 gl_info->gl_card = CARD_NVIDIA_GEFORCE_6600GT; 1745 vidmem = 128; /* A 6600GT has 128-256MB */ 1746 } 1747 /* Geforce6/7 lowend */ 1748 else { 1749 gl_info->gl_card = CARD_NVIDIA_GEFORCE_6200; /* Geforce 6100/6150/6200/7300/7400/7500 */ 1750 vidmem = 64; /* */ 1751 } 1752 } else if(WINE_D3D9_CAPABLE(gl_info)) { 1753 /* GeforceFX - highend */ 1754 if (strstr(gl_renderer, "5800") 1755 || strstr(gl_renderer, "5900") 1756 || strstr(gl_renderer, "5950") 1757 || strstr(gl_renderer, "Quadro FX")) 1758 { 1759 gl_info->gl_card = CARD_NVIDIA_GEFORCEFX_5800; 1760 vidmem = 256; /* 5800-5900 cards use 256MB */ 1761 } 1762 /* GeforceFX - midend */ 1763 else if (strstr(gl_renderer, "5600") 1764 || strstr(gl_renderer, "5650") 1765 || strstr(gl_renderer, "5700") 1766 || strstr(gl_renderer, "5750")) 1767 { 1768 gl_info->gl_card = CARD_NVIDIA_GEFORCEFX_5600; 1769 vidmem = 128; /* A 5600 uses 128-256MB */ 1770 } 1771 /* GeforceFX - lowend */ 1772 else { 1773 gl_info->gl_card = CARD_NVIDIA_GEFORCEFX_5200; /* GeforceFX 5100/5200/5250/5300/5500 */ 1774 vidmem = 64; /* Normal FX5200 cards use 64-256MB; laptop (non-standard) can have less */ 1775 } 1776 } else if(WINE_D3D8_CAPABLE(gl_info)) { 1777 if (strstr(gl_renderer, "GeForce4 Ti") || strstr(gl_renderer, "Quadro4")) 1778 { 1779 gl_info->gl_card = CARD_NVIDIA_GEFORCE4_TI4200; /* Geforce4 Ti4200/Ti4400/Ti4600/Ti4800, Quadro4 */ 1780 vidmem = 64; /* Geforce4 Ti cards have 64-128MB */ 1781 } 1782 else 1783 { 1784 gl_info->gl_card = CARD_NVIDIA_GEFORCE3; /* Geforce3 standard/Ti200/Ti500, Quadro DCC */ 1785 vidmem = 64; /* Geforce3 cards have 64-128MB */ 1786 } 1787 } else if(WINE_D3D7_CAPABLE(gl_info)) { 1788 if (strstr(gl_renderer, "GeForce4 MX")) 1789 { 1790 gl_info->gl_card = CARD_NVIDIA_GEFORCE4_MX; /* MX420/MX440/MX460/MX4000 */ 1791 vidmem = 64; /* Most Geforce4MX GPUs have at least 64MB of memory, some early models had 32MB but most have 64MB or even 128MB */ 1792 } 1793 else if(strstr(gl_renderer, "GeForce2 MX") || strstr(gl_renderer, "Quadro2 MXR")) 1794 { 1795 gl_info->gl_card = CARD_NVIDIA_GEFORCE2_MX; /* Geforce2 standard/MX100/MX200/MX400, Quadro2 MXR */ 1796 vidmem = 32; /* Geforce2MX GPUs have 32-64MB of video memory */ 1797 } 1798 else if(strstr(gl_renderer, "GeForce2") || strstr(gl_renderer, "Quadro2")) 1799 { 1800 gl_info->gl_card = CARD_NVIDIA_GEFORCE2; /* Geforce2 GTS/Pro/Ti/Ultra, Quadro2 */ 1801 vidmem = 32; /* Geforce2 GPUs have 32-64MB of video memory */ 1802 } 1803 else 1804 { 1805 gl_info->gl_card = CARD_NVIDIA_GEFORCE; /* Geforce 256/DDR, Quadro */ 1806 vidmem = 32; /* Most Geforce1 cards have 32MB, there are also some rare 16 and 64MB (Dell) models */ 1807 } 1808 } else { 1809 if (strstr(gl_renderer, "TNT2")) 1810 { 1811 gl_info->gl_card = CARD_NVIDIA_RIVA_TNT2; /* Riva TNT2 standard/M64/Pro/Ultra */ 1812 vidmem = 32; /* Most TNT2 boards have 32MB, though there are 16MB boards too */ 1813 } 1814 else 1815 { 1816 gl_info->gl_card = CARD_NVIDIA_RIVA_TNT; /* Riva TNT, Vanta */ 1817 vidmem = 16; /* Most TNT boards have 16MB, some rare models have 8MB */ 1818 } 1819 } 1820 break; 1821 case VENDOR_ATI: 1822 /* See http://developer.amd.com/drivers/pc_vendor_id/Pages/default.aspx 1823 * 1824 * beware: renderer string do not match exact card model, 1825 * eg HD 4800 is returned for multiple card, even for RV790 based one 1826 */ 1827 if(WINE_D3D9_CAPABLE(gl_info)) { 1828 /* Radeon R7xx HD4800 - highend */ 1829 if (strstr(gl_renderer, "HD 4800") /* Radeon RV7xx HD48xx generic renderer string */ 1830 || strstr(gl_renderer, "HD 4830") /* Radeon RV770 */ 1831 || strstr(gl_renderer, "HD 4850") /* Radeon RV770 */ 1832 || strstr(gl_renderer, "HD 4870") /* Radeon RV770 */ 1833 || strstr(gl_renderer, "HD 4890")) /* Radeon RV790 */ 1834 { 1835 gl_info->gl_card = CARD_ATI_RADEON_HD4800; 1836 vidmem = 512; /* note: HD4890 cards use 1024MB */ 1837 } 1838 /* Radeon R740 HD4700 - midend */ 1839 else if (strstr(gl_renderer, "HD 4700") /* Radeon RV770 */ 1840 || strstr(gl_renderer, "HD 4770")) /* Radeon RV740 */ 1841 { 1842 gl_info->gl_card = CARD_ATI_RADEON_HD4700; 1843 vidmem = 512; 1844 } 1845 /* Radeon R730 HD4600 - midend */ 1846 else if (strstr(gl_renderer, "HD 4600") /* Radeon RV730 */ 1847 || strstr(gl_renderer, "HD 4650") /* Radeon RV730 */ 1848 || strstr(gl_renderer, "HD 4670")) /* Radeon RV730 */ 1849 { 1850 gl_info->gl_card = CARD_ATI_RADEON_HD4600; 1851 vidmem = 512; 1852 } 1853 /* Radeon R710 HD4500/HD4350 - lowend */ 1854 else if (strstr(gl_renderer, "HD 4350") /* Radeon RV710 */ 1855 || strstr(gl_renderer, "HD 4550")) /* Radeon RV710 */ 1856 { 1857 gl_info->gl_card = CARD_ATI_RADEON_HD4350; 1858 vidmem = 256; 1859 } 1860 /* Radeon R6xx HD2900/HD3800 - highend */ 1861 else if (strstr(gl_renderer, "HD 2900") 1862 || strstr(gl_renderer, "HD 3870") 1863 || strstr(gl_renderer, "HD 3850")) 1864 { 1865 gl_info->gl_card = CARD_ATI_RADEON_HD2900; 1866 vidmem = 512; /* HD2900/HD3800 uses 256-1024MB */ 1867 } 1868 /* Radeon R6xx HD2600/HD3600 - midend; HD3830 is China-only midend */ 1869 else if (strstr(gl_renderer, "HD 2600") 1870 || strstr(gl_renderer, "HD 3830") 1871 || strstr(gl_renderer, "HD 3690") 1872 || strstr(gl_renderer, "HD 3650")) 1873 { 1874 gl_info->gl_card = CARD_ATI_RADEON_HD2600; 1875 vidmem = 256; /* HD2600/HD3600 uses 256-512MB */ 1876 } 1877 /* Radeon R6xx HD2300/HD2400/HD3400 - lowend */ 1878 else if (strstr(gl_renderer, "HD 2300") 1879 || strstr(gl_renderer, "HD 2400") 1880 || strstr(gl_renderer, "HD 3470") 1881 || strstr(gl_renderer, "HD 3450") 1882 || strstr(gl_renderer, "HD 3430") 1883 || strstr(gl_renderer, "HD 3400")) 1884 { 1885 gl_info->gl_card = CARD_ATI_RADEON_HD2300; 1886 vidmem = 128; /* HD2300 uses at least 128MB, HD2400 uses 256MB */ 1887 } 1888 /* Radeon R6xx/R7xx integrated */ 1889 else if (strstr(gl_renderer, "HD 3100") 1890 || strstr(gl_renderer, "HD 3200") 1891 || strstr(gl_renderer, "HD 3300")) 1892 { 1893 gl_info->gl_card = CARD_ATI_RADEON_HD3200; 1894 vidmem = 128; /* 128MB */ 1895 } 1896 /* Radeon R5xx */ 1897 else if (strstr(gl_renderer, "X1600") 1898 || strstr(gl_renderer, "X1650") 1899 || strstr(gl_renderer, "X1800") 1900 || strstr(gl_renderer, "X1900") 1901 || strstr(gl_renderer, "X1950")) 1902 { 1903 gl_info->gl_card = CARD_ATI_RADEON_X1600; 1904 vidmem = 128; /* X1600 uses 128-256MB, >=X1800 uses 256MB */ 1905 } 1906 /* Radeon R4xx + X1300/X1400/X1450/X1550/X2300 (lowend R5xx) */ 1907 else if(strstr(gl_renderer, "X700") 1908 || strstr(gl_renderer, "X800") 1909 || strstr(gl_renderer, "X850") 1910 || strstr(gl_renderer, "X1300") 1911 || strstr(gl_renderer, "X1400") 1912 || strstr(gl_renderer, "X1450") 1913 || strstr(gl_renderer, "X1550")) 1914 { 1915 gl_info->gl_card = CARD_ATI_RADEON_X700; 1916 vidmem = 128; /* x700/x8*0 use 128-256MB, >=x1300 128-512MB */ 1917 } 1918 /* Radeon Xpress Series - onboard, DX9b, Shader 2.0, 300-400MHz */ 1919 else if(strstr(gl_renderer, "Radeon Xpress")) 1920 { 1921 gl_info->gl_card = CARD_ATI_RADEON_XPRESS_200M; 1922 vidmem = 64; /* Shared RAM, BIOS configurable, 64-256M */ 1923 } 1924 /* Radeon R3xx */ 1925 else { 1926 gl_info->gl_card = CARD_ATI_RADEON_9500; /* Radeon 9500/9550/9600/9700/9800/X300/X550/X600 */ 1927 vidmem = 64; /* Radeon 9500 uses 64MB, higher models use up to 256MB */ 1928 } 1929 } else if(WINE_D3D8_CAPABLE(gl_info)) { 1930 gl_info->gl_card = CARD_ATI_RADEON_8500; /* Radeon 8500/9000/9100/9200/9300 */ 1931 vidmem = 64; /* 8500/9000 cards use mostly 64MB, though there are 32MB and 128MB models */ 1932 } else if(WINE_D3D7_CAPABLE(gl_info)) { 1933 gl_info->gl_card = CARD_ATI_RADEON_7200; /* Radeon 7000/7100/7200/7500 */ 1934 vidmem = 32; /* There are models with up to 64MB */ 1935 } else { 1936 gl_info->gl_card = CARD_ATI_RAGE_128PRO; 1937 vidmem = 16; /* There are 16-32MB models */ 1938 } 1939 break; 1940 case VENDOR_INTEL: 1941 if(strstr(gl_renderer, "X3100")) 1942 { 1943 /* MacOS calls the card GMA X3100, Google findings also suggest the name GM965 */ 1944 gl_info->gl_card = CARD_INTEL_X3100; 1945 vidmem = 128; 1946 } 1947 else if (strstr(gl_renderer, "GMA 950") || strstr(gl_renderer, "945GM")) 1948 { 1949 /* MacOS calls the card GMA 950, but everywhere else the PCI ID is named 945GM */ 1950 gl_info->gl_card = CARD_INTEL_I945GM; 1951 vidmem = 64; 1952 } 1953 else if (strstr(gl_renderer, "915GM")) 1954 { 1955 gl_info->gl_card = CARD_INTEL_I915GM; 1956 } 1957 else if (strstr(gl_renderer, "915G")) 1958 { 1959 gl_info->gl_card = CARD_INTEL_I915G; 1960 } 1961 else if (strstr(gl_renderer, "865G")) 1962 { 1963 gl_info->gl_card = CARD_INTEL_I865G; 1964 } 1965 else if (strstr(gl_renderer, "855G")) 1966 { 1967 gl_info->gl_card = CARD_INTEL_I855G; 1968 } 1969 else if (strstr(gl_renderer, "830G")) 1970 { 1971 gl_info->gl_card = CARD_INTEL_I830G; 1972 } else { 1973 gl_info->gl_card = CARD_INTEL_I915G; 1974 } 1975 break; 1976 case VENDOR_MESA: 1977 case VENDOR_WINE: 1978 default: 1979 /* Default to generic Nvidia hardware based on the supported OpenGL extensions. The choice 1980 * for Nvidia was because the hardware and drivers they make are of good quality. This makes 1981 * them a good generic choice. 1982 */ 1983 gl_info->gl_vendor = VENDOR_NVIDIA; 1984 if(WINE_D3D9_CAPABLE(gl_info)) 1985 gl_info->gl_card = CARD_NVIDIA_GEFORCEFX_5600; 1986 else if(WINE_D3D8_CAPABLE(gl_info)) 1987 gl_info->gl_card = CARD_NVIDIA_GEFORCE3; 1988 else if(WINE_D3D7_CAPABLE(gl_info)) 1989 gl_info->gl_card = CARD_NVIDIA_GEFORCE; 1990 else if(WINE_D3D6_CAPABLE(gl_info)) 1991 gl_info->gl_card = CARD_NVIDIA_RIVA_TNT; 1992 else 1993 gl_info->gl_card = CARD_NVIDIA_RIVA_128; 1994 } 1950 gl_info->gl_card = wined3d_guess_card(gl_info, gl_renderer, &gl_info->gl_vendor, &vidmem); 1995 1951 TRACE_(d3d_caps)("FOUND (fake) card: 0x%x (vendor id), 0x%x (device id)\n", gl_info->gl_vendor, gl_info->gl_card); 1996 1952 … … 2044 2000 memcpy(ThisExtn, Start, len); 2045 2001 ThisExtn[len] = '\0'; 2046 TRACE_(d3d_caps)("- %s\n", ThisExtn);2002 TRACE_(d3d_caps)("- %s\n", debugstr_a(ThisExtn)); 2047 2003 2048 2004 if (!strcmp(ThisExtn, "WGL_ARB_pbuffer")) { … … 2061 2017 } 2062 2018 } 2063 LEAVE_GL();2064 2019 2065 2020 fixup_extensions(gl_info, gl_renderer); … … 2131 2086 break; 2132 2087 2133 case WINED3DFMT_ X8R8G8B8:2088 case WINED3DFMT_B8G8R8X8_UNORM: 2134 2089 if (mode.dmBitsPerPel == 32) ++i; 2135 2090 break; 2136 2091 2137 case WINED3DFMT_ R5G6B5:2092 case WINED3DFMT_B5G6R5_UNORM: 2138 2093 if (mode.dmBitsPerPel == 16) ++i; 2139 2094 break; 2140 2095 2141 case WINED3DFMT_P8 :2096 case WINED3DFMT_P8_UINT: 2142 2097 if (mode.dmBitsPerPel == 8) ++i; 2143 2098 break; … … 2191 2146 DevModeW.dmBitsPerPel == 16) i++; 2192 2147 break; 2193 case WINED3DFMT_ X8R8G8B8:2148 case WINED3DFMT_B8G8R8X8_UNORM: 2194 2149 if (DevModeW.dmBitsPerPel == 32) i++; 2195 2150 break; 2196 case WINED3DFMT_ R5G6B5:2151 case WINED3DFMT_B5G6R5_UNORM: 2197 2152 if (DevModeW.dmBitsPerPel == 16) i++; 2198 2153 break; 2199 case WINED3DFMT_P8 :2154 case WINED3DFMT_P8_UINT: 2200 2155 if (DevModeW.dmBitsPerPel == 8) i++; 2201 2156 break; … … 2217 2172 pMode->Width = DevModeW.dmPelsWidth; 2218 2173 pMode->Height = DevModeW.dmPelsHeight; 2219 pMode->RefreshRate = WINED3DADAPTER_DEFAULT;2174 pMode->RefreshRate = DEFAULT_REFRESH_RATE; 2220 2175 if (DevModeW.dmFields & DM_DISPLAYFREQUENCY) 2221 2176 pMode->RefreshRate = DevModeW.dmDisplayFrequency; … … 2264 2219 pMode->Height = DevModeW.dmPelsHeight; 2265 2220 bpp = DevModeW.dmBitsPerPel; 2266 pMode->RefreshRate = WINED3DADAPTER_DEFAULT;2221 pMode->RefreshRate = DEFAULT_REFRESH_RATE; 2267 2222 if (DevModeW.dmFields&DM_DISPLAYFREQUENCY) 2268 2223 { … … 2422 2377 } 2423 2378 2424 if ((format_desc->format == WINED3DFMT_D16_LOCKABLE) || (format_desc->format == WINED3DFMT_D32 F_LOCKABLE))2379 if ((format_desc->format == WINED3DFMT_D16_LOCKABLE) || (format_desc->format == WINED3DFMT_D32_FLOAT)) 2425 2380 lockable = TRUE; 2426 2381 … … 2483 2438 } 2484 2439 2485 static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, 2486 WINED3DFORMAT SurfaceFormat, 2487 BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) { 2488 2440 static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, 2441 WINED3DFORMAT SurfaceFormat, BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels) 2442 { 2489 2443 IWineD3DImpl *This = (IWineD3DImpl *)iface; 2490 2444 const struct GlPixelFormatDesc *glDesc; … … 2606 2560 2607 2561 /* There are only 4 display formats */ 2608 if (!((DisplayFormat == WINED3DFMT_R5G6B5) ||2609 (DisplayFormat == WINED3DFMT_X1R5G5B5) ||2610 (DisplayFormat == WINED3DFMT_X8R8G8B8) ||2611 (DisplayFormat == WINED3DFMT_A2R10G10B10)))2562 if (!(DisplayFormat == WINED3DFMT_B5G6R5_UNORM 2563 || DisplayFormat == WINED3DFMT_B5G5R5X1_UNORM 2564 || DisplayFormat == WINED3DFMT_B8G8R8X8_UNORM 2565 || DisplayFormat == WINED3DFMT_B10G10R10A2_UNORM)) 2612 2566 { 2613 2567 TRACE_(d3d_caps)("Format %s unsupported as display format\n", debug_d3dformat(DisplayFormat)); … … 2629 2583 2630 2584 /* In FULLSCREEN mode R5G6B5 can only be mixed with backbuffer format R5G6B5 */ 2631 if( (DisplayFormat == WINED3DFMT_R5G6B5) && (BackBufferFormat != WINED3DFMT_R5G6B5) ) { 2585 if (DisplayFormat == WINED3DFMT_B5G6R5_UNORM && BackBufferFormat != WINED3DFMT_B5G6R5_UNORM) 2586 { 2632 2587 TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat)); 2633 2588 return WINED3DERR_NOTAVAILABLE; … … 2635 2590 2636 2591 /* In FULLSCREEN mode X1R5G5B5 can only be mixed with backbuffer format *1R5G5B5 */ 2637 if( (DisplayFormat == WINED3DFMT_X1R5G5B5) && !((BackBufferFormat == WINED3DFMT_X1R5G5B5) || (BackBufferFormat == WINED3DFMT_A1R5G5B5)) ) { 2592 if (DisplayFormat == WINED3DFMT_B5G5R5X1_UNORM 2593 && !(BackBufferFormat == WINED3DFMT_B5G5R5X1_UNORM || BackBufferFormat == WINED3DFMT_B5G5R5A1_UNORM)) 2594 { 2638 2595 TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat)); 2639 2596 return WINED3DERR_NOTAVAILABLE; … … 2641 2598 2642 2599 /* In FULLSCREEN mode X8R8G8B8 can only be mixed with backbuffer format *8R8G8B8 */ 2643 if( (DisplayFormat == WINED3DFMT_X8R8G8B8) && !((BackBufferFormat == WINED3DFMT_X8R8G8B8) || (BackBufferFormat == WINED3DFMT_A8R8G8B8)) ) { 2600 if (DisplayFormat == WINED3DFMT_B8G8R8X8_UNORM 2601 && !(BackBufferFormat == WINED3DFMT_B8G8R8X8_UNORM || BackBufferFormat == WINED3DFMT_B8G8R8A8_UNORM)) 2602 { 2644 2603 TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat)); 2645 2604 return WINED3DERR_NOTAVAILABLE; … … 2647 2606 2648 2607 /* A2R10G10B10 is only allowed in fullscreen mode and it can only be mixed with backbuffer format A2R10G10B10 */ 2649 if( (DisplayFormat == WINED3DFMT_A2R10G10B10) && ((BackBufferFormat != WINED3DFMT_A2R10G10B10) || Windowed)) { 2608 if (DisplayFormat == WINED3DFMT_B10G10R10A2_UNORM 2609 && (BackBufferFormat != WINED3DFMT_B10G10R10A2_UNORM || Windowed)) 2610 { 2650 2611 TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s/%s\n", debug_d3dformat(DisplayFormat), debug_d3dformat(BackBufferFormat)); 2651 2612 return WINED3DERR_NOTAVAILABLE; … … 2671 2632 case WINED3DFMT_R8G8_SNORM: 2672 2633 case WINED3DFMT_R16G16_SNORM: 2673 case WINED3DFMT_ L6V5U5:2674 case WINED3DFMT_ X8L8V8U8:2634 case WINED3DFMT_R5G5_SNORM_L6_UNORM: 2635 case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: 2675 2636 case WINED3DFMT_R8G8B8A8_SNORM: 2676 2637 /* Ask the fixed function pipeline implementation if it can deal … … 2796 2757 switch (format_desc->format) 2797 2758 { 2798 case WINED3DFMT_ A8R8G8B8:2799 case WINED3DFMT_ X8R8G8B8:2800 case WINED3DFMT_ A4R4G4B4:2801 case WINED3DFMT_L8 :2802 case WINED3DFMT_ A8L8:2759 case WINED3DFMT_B8G8R8A8_UNORM: 2760 case WINED3DFMT_B8G8R8X8_UNORM: 2761 case WINED3DFMT_B4G4R4A4_UNORM: 2762 case WINED3DFMT_L8_UNORM: 2763 case WINED3DFMT_L8A8_UNORM: 2803 2764 case WINED3DFMT_DXT1: 2804 2765 case WINED3DFMT_DXT2: … … 2822 2783 * doing the color fixup in shaders. 2823 2784 * Note Windows drivers (at least on the Geforce 8800) also offer this on R5G6B5. */ 2824 if ((format_desc->format == WINED3DFMT_ X8R8G8B8) || (format_desc->format == WINED3DFMT_A8R8G8B8))2785 if ((format_desc->format == WINED3DFMT_B8G8R8X8_UNORM) || (format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)) 2825 2786 { 2826 2787 int vs_selected_mode; 2827 2788 int ps_selected_mode; 2828 select_shader_mode(&adapter->gl_info, DeviceType,&ps_selected_mode, &vs_selected_mode);2789 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 2829 2790 2830 2791 if((ps_selected_mode == SHADER_ARB) || (ps_selected_mode == SHADER_GLSL)) { … … 2875 2836 * supported: RGB(A) formats 2876 2837 */ 2877 case WINED3DFMT_ R8G8B8: /* Enable for dx7, blacklisted for 8 and 9 above */2878 case WINED3DFMT_ A8R8G8B8:2879 case WINED3DFMT_ X8R8G8B8:2880 case WINED3DFMT_ R5G6B5:2881 case WINED3DFMT_ X1R5G5B5:2882 case WINED3DFMT_ A1R5G5B5:2883 case WINED3DFMT_ A4R4G4B4:2838 case WINED3DFMT_B8G8R8_UNORM: /* Enable for dx7, blacklisted for 8 and 9 above */ 2839 case WINED3DFMT_B8G8R8A8_UNORM: 2840 case WINED3DFMT_B8G8R8X8_UNORM: 2841 case WINED3DFMT_B5G6R5_UNORM: 2842 case WINED3DFMT_B5G5R5X1_UNORM: 2843 case WINED3DFMT_B5G5R5A1_UNORM: 2844 case WINED3DFMT_B4G4R4A4_UNORM: 2884 2845 case WINED3DFMT_A8_UNORM: 2885 case WINED3DFMT_ X4R4G4B4:2846 case WINED3DFMT_B4G4R4X4_UNORM: 2886 2847 case WINED3DFMT_R8G8B8A8_UNORM: 2887 case WINED3DFMT_ X8B8G8R8:2888 case WINED3DFMT_ A2R10G10B10:2848 case WINED3DFMT_R8G8B8X8_UNORM: 2849 case WINED3DFMT_B10G10R10A2_UNORM: 2889 2850 case WINED3DFMT_R10G10B10A2_UNORM: 2890 2851 case WINED3DFMT_R16G16_UNORM: 2891 case WINED3DFMT_R16G16B16A16_UNORM:2892 2852 TRACE_(d3d_caps)("[OK]\n"); 2893 2853 return TRUE; 2894 2854 2895 case WINED3DFMT_ R3G3B2:2855 case WINED3DFMT_B2G3R3_UNORM: 2896 2856 TRACE_(d3d_caps)("[FAILED] - Not supported on Windows\n"); 2897 2857 return FALSE; … … 2900 2860 * supported: Palettized 2901 2861 */ 2902 case WINED3DFMT_P8 :2862 case WINED3DFMT_P8_UINT: 2903 2863 TRACE_(d3d_caps)("[OK]\n"); 2904 2864 return TRUE; 2905 /* No Windows driver offers A8P8, so don't offer it either */2906 case WINED3DFMT_ A8P8:2865 /* No Windows driver offers WINED3DFMT_P8_UINT_A8_UNORM, so don't offer it either */ 2866 case WINED3DFMT_P8_UINT_A8_UNORM: 2907 2867 return FALSE; 2908 2868 … … 2910 2870 * Supported: (Alpha)-Luminance 2911 2871 */ 2912 case WINED3DFMT_L8 :2913 case WINED3DFMT_ A8L8:2914 case WINED3DFMT_L16 :2872 case WINED3DFMT_L8_UNORM: 2873 case WINED3DFMT_L8A8_UNORM: 2874 case WINED3DFMT_L16_UNORM: 2915 2875 TRACE_(d3d_caps)("[OK]\n"); 2916 2876 return TRUE; 2917 2877 2918 2878 /* Not supported on Windows, thus disabled */ 2919 case WINED3DFMT_ A4L4:2879 case WINED3DFMT_L4A4_UNORM: 2920 2880 TRACE_(d3d_caps)("[FAILED] - not supported on windows\n"); 2921 2881 return FALSE; … … 2926 2886 case WINED3DFMT_D16_LOCKABLE: 2927 2887 case WINED3DFMT_D16_UNORM: 2928 case WINED3DFMT_ D15S1:2929 case WINED3DFMT_ D24X8:2930 case WINED3DFMT_ D24X4S4:2931 case WINED3DFMT_ D24S8:2932 case WINED3DFMT_ D24FS8:2933 case WINED3DFMT_D32 :2934 case WINED3DFMT_D32 F_LOCKABLE:2888 case WINED3DFMT_S1_UINT_D15_UNORM: 2889 case WINED3DFMT_X8D24_UNORM: 2890 case WINED3DFMT_S4X4_UINT_D24_UNORM: 2891 case WINED3DFMT_S8_UINT_D24_UNORM: 2892 case WINED3DFMT_S8_UINT_D24_FLOAT: 2893 case WINED3DFMT_D32_UNORM: 2894 case WINED3DFMT_D32_FLOAT: 2935 2895 return TRUE; 2936 2896 … … 2940 2900 */ 2941 2901 case WINED3DFMT_R8G8_SNORM: 2942 case WINED3DFMT_ X8L8V8U8:2943 case WINED3DFMT_ L6V5U5:2902 case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: 2903 case WINED3DFMT_R5G5_SNORM_L6_UNORM: 2944 2904 case WINED3DFMT_R8G8B8A8_SNORM: 2945 2905 case WINED3DFMT_R16G16_SNORM: … … 2976 2936 case WINED3DFMT_R32_UINT: 2977 2937 case WINED3DFMT_R16G16B16A16_SNORM: 2978 case WINED3DFMT_ A2W10V10U10:2979 case WINED3DFMT_ W11V11U10:2938 case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: 2939 case WINED3DFMT_R10G11B11_SNORM: 2980 2940 TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ 2981 2941 return FALSE; 2982 2942 2983 2943 /***** 2984 * WINED3DFMT_ CxV8U8: Not supported right now2944 * WINED3DFMT_R8G8_SNORM_Cx: Not supported right now 2985 2945 */ 2986 case WINED3DFMT_ CxV8U8:2946 case WINED3DFMT_R8G8_SNORM_Cx: 2987 2947 TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ 2988 2948 return FALSE; … … 3002 2962 3003 2963 /* Not supported */ 3004 case WINED3DFMT_A8R3G3B2: 2964 case WINED3DFMT_R16G16B16A16_UNORM: 2965 case WINED3DFMT_B2G3R3A8_UNORM: 3005 2966 TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ 3006 2967 return FALSE; … … 3100 3061 switch(check_format_desc->format) 3101 3062 { 3102 case WINED3DFMT_ R8G8B8:3103 case WINED3DFMT_ A8R8G8B8:3104 case WINED3DFMT_ X8R8G8B8:3105 case WINED3DFMT_ R5G6B5:3106 case WINED3DFMT_ X1R5G5B5:3107 case WINED3DFMT_ A1R5G5B5:3108 case WINED3DFMT_ A4R4G4B4:3109 case WINED3DFMT_ R3G3B2:3063 case WINED3DFMT_B8G8R8_UNORM: 3064 case WINED3DFMT_B8G8R8A8_UNORM: 3065 case WINED3DFMT_B8G8R8X8_UNORM: 3066 case WINED3DFMT_B5G6R5_UNORM: 3067 case WINED3DFMT_B5G5R5X1_UNORM: 3068 case WINED3DFMT_B5G5R5A1_UNORM: 3069 case WINED3DFMT_B4G4R4A4_UNORM: 3070 case WINED3DFMT_B2G3R3_UNORM: 3110 3071 case WINED3DFMT_A8_UNORM: 3111 case WINED3DFMT_ A8R3G3B2:3112 case WINED3DFMT_ X4R4G4B4:3072 case WINED3DFMT_B2G3R3A8_UNORM: 3073 case WINED3DFMT_B4G4R4X4_UNORM: 3113 3074 case WINED3DFMT_R10G10B10A2_UNORM: 3114 3075 case WINED3DFMT_R8G8B8A8_UNORM: 3115 case WINED3DFMT_ X8B8G8R8:3076 case WINED3DFMT_R8G8B8X8_UNORM: 3116 3077 case WINED3DFMT_R16G16_UNORM: 3117 case WINED3DFMT_ A2R10G10B10:3078 case WINED3DFMT_B10G10R10A2_UNORM: 3118 3079 case WINED3DFMT_R16G16B16A16_UNORM: 3119 case WINED3DFMT_P8 :3080 case WINED3DFMT_P8_UINT: 3120 3081 TRACE_(d3d_caps)("[OK]\n"); 3121 3082 return TRUE; … … 3170 3131 } 3171 3132 3172 static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, 3133 static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, 3173 3134 WINED3DFORMAT AdapterFormat, DWORD Usage, WINED3DRESOURCETYPE RType, WINED3DFORMAT CheckFormat, 3174 WINED3DSURFTYPE SurfaceType) { 3135 WINED3DSURFTYPE SurfaceType) 3136 { 3175 3137 IWineD3DImpl *This = (IWineD3DImpl *)iface; 3176 3138 struct WineD3DAdapter *adapter = &This->adapters[Adapter]; … … 3606 3568 */ 3607 3569 switch(CheckFormat) { 3608 case WINED3DFMT_P8 :3609 case WINED3DFMT_ A4L4:3570 case WINED3DFMT_P8_UINT: 3571 case WINED3DFMT_L4A4_UNORM: 3610 3572 case WINED3DFMT_R32_FLOAT: 3611 3573 case WINED3DFMT_R16_FLOAT: 3612 case WINED3DFMT_ X8L8V8U8:3613 case WINED3DFMT_ L6V5U5:3574 case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: 3575 case WINED3DFMT_R5G5_SNORM_L6_UNORM: 3614 3576 case WINED3DFMT_R16G16_UNORM: 3615 3577 TRACE_(d3d_caps)("[FAILED] - No converted formats on volumes\n"); … … 3686 3648 int ps_selected_mode; 3687 3649 3688 select_shader_mode(&adapter->gl_info, DeviceType,&ps_selected_mode, &vs_selected_mode);3650 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 3689 3651 if (vs_selected_mode == SHADER_GLSL || ps_selected_mode == SHADER_GLSL) { 3690 3652 ret = &glsl_shader_backend; … … 3704 3666 int ps_selected_mode; 3705 3667 3706 select_shader_mode(&adapter->gl_info, DeviceType,&ps_selected_mode, &vs_selected_mode);3668 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 3707 3669 if((ps_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_GLSL) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) { 3708 3670 return &arbfp_fragment_pipeline; … … 3724 3686 int ps_selected_mode; 3725 3687 3726 select_shader_mode(&adapter->gl_info, DeviceType,&ps_selected_mode, &vs_selected_mode);3688 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 3727 3689 if((ps_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_GLSL) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) { 3728 3690 return &arbfp_blit; … … 3754 3716 } 3755 3717 3756 select_shader_mode(&adapter->gl_info, DeviceType,&ps_selected_mode, &vs_selected_mode);3718 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 3757 3719 3758 3720 /* This function should *not* be modifying GL caps … … 4076 4038 4077 4039 4040 /* FIXME: Add D3DVTXPCAPS_TWEENING, D3DVTXPCAPS_TEXGEN_SPHEREMAP */ 4078 4041 pCaps->VertexProcessingCaps = WINED3DVTXPCAPS_DIRECTIONALLIGHTS | 4079 4042 WINED3DVTXPCAPS_MATERIALSOURCE7 | … … 4082 4045 WINED3DVTXPCAPS_VERTEXFOG | 4083 4046 WINED3DVTXPCAPS_TEXGEN; 4084 /* FIXME: Add4085 D3DVTXPCAPS_TWEENING, D3DVTXPCAPS_TEXGEN_SPHEREMAP */4086 4047 4087 4048 pCaps->MaxPrimitiveCount = 0xFFFFF; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */ … … 4373 4334 object->devType = DeviceType; 4374 4335 4375 select_shader_mode(&adapter->gl_info, DeviceType, 4376 &object->ps_selected_mode, &object->vs_selected_mode); 4336 select_shader_mode(&adapter->gl_info, &object->ps_selected_mode, &object->vs_selected_mode); 4377 4337 object->shader_backend = select_shader_backend(adapter, DeviceType); 4378 4338 … … 4425 4385 *pParent = This->parent; 4426 4386 return WINED3D_OK; 4427 }4428 4429 ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface) {4430 IUnknown* surfaceParent;4431 TRACE("(%p) call back\n", pSurface);4432 4433 /* Now, release the parent, which will take care of cleaning up the surface for us */4434 IWineD3DSurface_GetParent(pSurface, &surfaceParent);4435 IUnknown_Release(surfaceParent);4436 return IUnknown_Release(surfaceParent);4437 4387 } 4438 4388 … … 4672 4622 */ 4673 4623 #ifdef USE_WIN32_OPENGL 4674 glFinish = (void*)GetProcAddress(mod_gl, "glFinish");4675 glFlush = (void*)GetProcAddress(mod_gl, "glFlush");4624 wglFinish = (void*)GetProcAddress(mod_gl, "glFinish"); 4625 wglFlush = (void*)GetProcAddress(mod_gl, "glFlush"); 4676 4626 #else 4677 glFinish = (void*)pwglGetProcAddress("wglFinish");4678 glFlush = (void*)pwglGetProcAddress("wglFlush");4627 wglFinish = (void*)pwglGetProcAddress("wglFinish"); 4628 wglFlush = (void*)pwglGetProcAddress("wglFlush"); 4679 4629 #endif 4680 4630 … … 4882 4832 WineD3D_ReleaseFakeGLContext(&fake_gl_ctx); 4883 4833 4884 select_shader_mode(&adapter->gl_info, WINED3DDEVTYPE_HAL,&ps_selected_mode, &vs_selected_mode);4834 select_shader_mode(&adapter->gl_info, &ps_selected_mode, &vs_selected_mode); 4885 4835 select_shader_max_constants(ps_selected_mode, vs_selected_mode, &adapter->gl_info); 4886 4836 fillGLAttribFuncs(&adapter->gl_info); … … 4941 4891 IWineD3DImpl_CreateDevice 4942 4892 }; 4893 4894 static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {} 4895 4896 const struct wined3d_parent_ops wined3d_null_parent_ops = 4897 { 4898 wined3d_null_wined3d_object_destroyed, 4899 }; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/drawprim.c
r22496 r23571 8 8 * Copyright 2006, 2008 Henri Verbeet 9 9 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 10 * Copyright 2009 Henri Verbeet for CodeWeavers 10 11 * 11 12 * This library is free software; you can redistribute it and/or … … 46 47 /* GL locking is done by the caller */ 47 48 static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type, 48 UINT min_vertex_idx, UINT max_vertex_idx, UINT count, UINT idx_size, 49 const void *idx_data, UINT start_idx) 49 UINT count, UINT idx_size, const void *idx_data, UINT start_idx) 50 50 { 51 51 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 53 53 if (idx_size) 54 54 { 55 TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, primitive_type, count, min_vertex_idx); 56 57 #if 1 55 TRACE("(%p) : glElements(%x, %d, ...)\n", This, primitive_type, count); 56 58 57 glDrawElements(primitive_type, count, 59 58 idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, 60 59 (const char *)idx_data + (idx_size * start_idx)); 61 60 checkGLcall("glDrawElements"); 62 #else63 glDrawRangeElements(primitive_type, min_vertex_idx, max_vertex_idx, count,64 idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT,65 (const char *)idx_data + (idx_size * start_idx));66 checkGLcall("glDrawRangeElements");67 #endif68 61 } 69 62 else … … 84 77 static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context *context, 85 78 const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType, 86 const void *idxData, UINT idxSize, UINT minIndex, UINTstartIdx)79 const void *idxData, UINT idxSize, UINT startIdx) 87 80 { 88 81 unsigned int textureNo = 0; … … 125 118 glBegin(glPrimType); 126 119 127 element = &si->elements[WINED3D_FFP_POSITION]; 128 if (element->data) position = element->data + streamOffset[element->stream_idx]; 129 130 element = &si->elements[WINED3D_FFP_NORMAL]; 131 if (element->data) normal = element->data + streamOffset[element->stream_idx]; 132 else glNormal3f(0, 0, 0); 133 134 element = &si->elements[WINED3D_FFP_DIFFUSE]; 135 if (element->data) diffuse = element->data + streamOffset[element->stream_idx]; 136 else glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 120 if (si->use_map & (1 << WINED3D_FFP_POSITION)) 121 { 122 element = &si->elements[WINED3D_FFP_POSITION]; 123 position = element->data + streamOffset[element->stream_idx]; 124 } 125 126 if (si->use_map & (1 << WINED3D_FFP_NORMAL)) 127 { 128 element = &si->elements[WINED3D_FFP_NORMAL]; 129 normal = element->data + streamOffset[element->stream_idx]; 130 } 131 else 132 { 133 glNormal3f(0, 0, 0); 134 } 135 137 136 num_untracked_materials = context->num_untracked_materials; 138 if (num_untracked_materials && element->format_desc->format != WINED3DFMT_A8R8G8B8) 139 FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->format)); 140 141 element = &si->elements[WINED3D_FFP_SPECULAR]; 142 if (element->data) 143 { 137 if (si->use_map & (1 << WINED3D_FFP_DIFFUSE)) 138 { 139 element = &si->elements[WINED3D_FFP_DIFFUSE]; 140 diffuse = element->data + streamOffset[element->stream_idx]; 141 142 if (num_untracked_materials && element->format_desc->format != WINED3DFMT_B8G8R8A8_UNORM) 143 FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->format)); 144 } 145 else 146 { 147 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 148 } 149 150 if (si->use_map & (1 << WINED3D_FFP_SPECULAR)) 151 { 152 element = &si->elements[WINED3D_FFP_SPECULAR]; 144 153 specular = element->data + streamOffset[element->stream_idx]; 145 154 … … 152 161 if (GL_SUPPORT(EXT_FOG_COORD)) 153 162 { 154 if (element->format_desc->format == WINED3DFMT_ A8R8G8B8) specular_fog = TRUE;163 if (element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) specular_fog = TRUE; 155 164 else FIXME("Implement fog coordinates from %s\n", debug_d3dformat(element->format_desc->format)); 156 165 } … … 176 185 { 177 186 int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; 178 inttexture_idx = This->texUnitMap[textureNo];187 DWORD texture_idx = This->texUnitMap[textureNo]; 179 188 180 189 if (!GL_SUPPORT(ARB_MULTITEXTURE) && textureNo > 0) … … 186 195 if (!pixelShader && !This->stateBlock->textures[textureNo]) continue; 187 196 188 if (texture_idx == -1) continue;197 if (texture_idx == WINED3D_UNMAPPED_STAGE) continue; 189 198 190 199 if (coordIdx > 7) … … 199 208 } 200 209 201 element = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx];202 if (element->data)203 {210 if (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coordIdx))) 211 { 212 element = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx]; 204 213 texCoords[coordIdx] = element->data + streamOffset[element->stream_idx]; 205 214 tex_mask |= (1 << textureNo); … … 244 253 int coord_idx; 245 254 const void *ptr; 246 inttexture_idx;255 DWORD texture_idx; 247 256 248 257 if (!(tmp_tex_mask & 1)) continue; … … 335 344 GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr)); 336 345 break; 337 case WINED3DFMT_ A8R8G8B8:346 case WINED3DFMT_B8G8R8A8_UNORM: 338 347 if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)) 339 348 { … … 419 428 /* GL locking is done by the caller */ 420 429 static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT numberOfVertices, 421 GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT minIndex, UINTstartIdx)430 GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT startIdx) 422 431 { 423 432 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; … … 463 472 } 464 473 465 for(i = MAX_ATTRIBS - 1; i >= 0; i--) { 466 if(!si->elements[i].data) continue; 474 for (i = MAX_ATTRIBS - 1; i >= 0; i--) 475 { 476 if (!(si->use_map & (1 << i))) continue; 467 477 468 478 ptr = si->elements[i].data + … … 480 490 /* GL locking is done by the caller */ 481 491 static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wined3d_stream_info *si, 482 UINT numberOfVertices, GLenum glPrimitiveType, const void *idxData, UINT idxSize, UINT minIndex,492 UINT numberOfVertices, GLenum glPrimitiveType, const void *idxData, UINT idxSize, 483 493 UINT startIdx) 484 494 { … … 500 510 } 501 511 502 TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, glPrimitiveType, numberOfVertices, minIndex);512 TRACE("(%p) : glElements(%x, %d, ...)\n", This, glPrimitiveType, numberOfVertices); 503 513 504 514 /* First, figure out how many instances we have to draw */ … … 518 528 for (i = 0; i < sizeof(si->elements) / sizeof(*si->elements); ++i) 519 529 { 530 if (!(si->use_map & (1 << i))) continue; 531 520 532 if (stateblock->streamFlags[si->elements[i].stream_idx] & WINED3DSTREAMSOURCE_INSTANCEDATA) 521 533 { … … 554 566 for (i = 0; i < (sizeof(s->elements) / sizeof(*s->elements)); ++i) 555 567 { 556 struct wined3d_stream_info_element *e = &s->elements[i]; 568 struct wined3d_stream_info_element *e; 569 570 if (!(s->use_map & (1 << i))) continue; 571 572 e = &s->elements[i]; 557 573 if (e->buffer_object) 558 574 { … … 565 581 566 582 /* Routine common to the draw primitive and draw indexed primitive routines */ 567 void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertices, 568 UINT StartIdx, UINT idxSize, const void *idxData, UINT minIndex) 583 void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT idxSize, const void *idxData) 569 584 { 570 585 … … 616 631 const struct wined3d_stream_info *stream_info = &This->strided_streams; 617 632 struct wined3d_stream_info stridedlcl; 618 619 if (!numberOfVertices) numberOfVertices = index_count;620 633 621 634 if (!use_vs(This->stateBlock)) … … 666 679 TRACE("Using immediate mode with vertex shaders for half float emulation\n"); 667 680 } 668 drawStridedSlowVs(iface, stream_info, index_count, glPrimType, idxData, idxSize, minIndex,StartIdx);681 drawStridedSlowVs(iface, stream_info, index_count, glPrimType, idxData, idxSize, StartIdx); 669 682 } else { 670 683 drawStridedSlow(iface, context, stream_info, index_count, 671 glPrimType, idxData, idxSize, minIndex,StartIdx);684 glPrimType, idxData, idxSize, StartIdx); 672 685 } 673 686 } else if(This->instancedDraw) { 674 687 /* Instancing emulation with mixing immediate mode and arrays */ 675 688 drawStridedInstanced(iface, &This->strided_streams, index_count, 676 glPrimType, idxData, idxSize, minIndex,StartIdx);689 glPrimType, idxData, idxSize, StartIdx); 677 690 } else { 678 drawStridedFast(iface, glPrimType, minIndex, minIndex + numberOfVertices - 1, 679 index_count, idxSize, idxData, StartIdx); 691 drawStridedFast(iface, glPrimType, index_count, idxSize, idxData, StartIdx); 680 692 } 681 693 } … … 689 701 { 690 702 static long int primCounter = 0; 691 /* NOTE: set primCounter to the value reported by drawprim 703 /* NOTE: set primCounter to the value reported by drawprim 692 704 before you want to to write frame makeup to /tmp */ 693 705 if (primCounter >= 0) { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c
r22496 r23571 2 2 * GLSL pixel and vertex shader implementation 3 3 * 4 * Copyright 2006 Jason Green 4 * Copyright 2006 Jason Green 5 5 * Copyright 2006-2007 Henri Verbeet 6 6 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers … … 198 198 { 199 199 "Vertex shader was successfully compiled to run on hardware.\n", /* fglrx */ 200 "Fragment shader was successfully compiled to run on hardware.\n", /* fglrx */ 200 "Fragment shader was successfully compiled to run on hardware.\n", /* fglrx, with \n */ 201 "Fragment shader was successfully compiled to run on hardware.", /* fglrx, no \n */ 201 202 "Fragment shader(s) linked, vertex shader(s) linked. \n ", /* fglrx, with \n */ 202 203 "Fragment shader(s) linked, vertex shader(s) linked.", /* fglrx, no \n */ 203 204 "Vertex shader(s) linked, no fragment shader(s) defined. \n ", /* fglrx, with \n */ 204 205 "Vertex shader(s) linked, no fragment shader(s) defined.", /* fglrx, no \n */ 205 "Fragment shader was successfully compiled to run on hardware.\n"206 "Fragment shader(s) linked, no vertex shader(s) defined. \n ", /* fglrx, with \n */ 206 207 "Fragment shader(s) linked, no vertex shader(s) defined.", /* fglrx, no \n */ 207 "Fragment shader(s) linked, no vertex shader(s) defined. \n ", /* fglrx, with \n */208 208 }; 209 209 … … 825 825 unsigned int i, extra_constants_needed = 0; 826 826 const local_constant *lconst; 827 DWORD map; 827 828 828 829 /* There are some minor differences between pixel and vertex shaders */ … … 831 832 832 833 /* Prototype the subroutines */ 833 for (i = 0 ; i < This->baseShader.limits.label; i++) {834 if (reg_maps->labels[i])835 834 for (i = 0, map = reg_maps->labels; map; map >>= 1, ++i) 835 { 836 if (map & 1) shader_addline(buffer, "void subroutine%u();\n", i); 836 837 } 837 838 … … 909 910 } 910 911 } else { 911 for(i = 0; i < (sizeof(reg_maps->bumpmat) / sizeof(reg_maps->bumpmat[0])); i++) { 912 if(!reg_maps->bumpmat[i]) { 913 continue; 914 } 912 for (i = 0, map = reg_maps->bumpmat; map; map >>= 1, ++i) 913 { 914 if (!(map & 1)) continue; 915 915 916 916 shader_addline(buffer, "uniform mat2 bumpenvmat%d;\n", i); 917 917 918 if(reg_maps->luminanceparams) { 918 if (reg_maps->luminanceparams & (1 << i)) 919 { 919 920 shader_addline(buffer, "uniform float luminancescale%d;\n", i); 920 921 shader_addline(buffer, "uniform float luminanceoffset%d;\n", i); … … 950 951 } 951 952 952 /* Declare texture samplers */ 953 /* Declare texture samplers */ 953 954 for (i = 0; i < This->baseShader.limits.sampler; i++) { 954 955 if (reg_maps->sampler_type[i]) … … 984 985 * This is NOT done inside the loop that declares the texture samplers since the NP2 fixup code 985 986 * is currently only used for the GeforceFX series and when forcing the ARB_npot extension off. 986 * Modern cards just skip the code anyway, so put it inside a sep erate loop. */987 * Modern cards just skip the code anyway, so put it inside a separate loop. */ 987 988 if (pshader && ps_args->np2_fixup) { 988 989 … … 1013 1014 1014 1015 /* Declare address variables */ 1015 for (i = 0 ; i < This->baseShader.limits.address; i++) {1016 if (reg_maps->address[i])1017 shader_addline(buffer, "ivec4 A%d;\n", i);1016 for (i = 0, map = reg_maps->address; map; map >>= 1, ++i) 1017 { 1018 if (map & 1) shader_addline(buffer, "ivec4 A%u;\n", i); 1018 1019 } 1019 1020 1020 1021 /* Declare texture coordinate temporaries and initialize them */ 1021 for (i = 0 ; i < This->baseShader.limits.texcoord; i++) {1022 if (reg_maps->texcoord[i])1023 1022 for (i = 0, map = reg_maps->texcoord; map; map >>= 1, ++i) 1023 { 1024 if (map & 1) shader_addline(buffer, "vec4 T%u = gl_TexCoord[%u];\n", i, i); 1024 1025 } 1025 1026 … … 1047 1048 1048 1049 /* Declare temporary variables */ 1049 for (i = 0; i < This->baseShader.limits.temporary; i++) {1050 if (reg_maps->temporary[i])1051 1050 for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i) 1051 { 1052 if (map & 1) shader_addline(buffer, "vec4 R%u;\n", i); 1052 1053 } 1053 1054 … … 1055 1056 if (reg_maps->shader_version.type == WINED3D_SHADER_TYPE_VERTEX) 1056 1057 { 1057 WORD map = reg_maps->input_registers; 1058 1059 for (i = 0; map; map >>= 1, ++i) 1058 for (i = 0, map = reg_maps->input_registers; map; map >>= 1, ++i) 1060 1059 { 1061 if (!(map & 1)) continue; 1062 1063 shader_addline(buffer, "attribute vec4 attrib%i;\n", i); 1060 if (map & 1) shader_addline(buffer, "attribute vec4 attrib%i;\n", i); 1064 1061 } 1065 1062 } … … 1118 1115 /** Used for opcode modifiers - They multiply the result by the specified amount */ 1119 1116 static const char * const shift_glsl_tab[] = { 1120 "", /* 0 (none) */ 1121 "2.0 * ", /* 1 (x2) */ 1122 "4.0 * ", /* 2 (x4) */ 1123 "8.0 * ", /* 3 (x8) */ 1124 "16.0 * ", /* 4 (x16) */ 1125 "32.0 * ", /* 5 (x32) */ 1126 "", /* 6 (x64) */ 1127 "", /* 7 (x128) */ 1128 "", /* 8 (d256) */ 1129 "", /* 9 (d128) */ 1130 "", /* 10 (d64) */ 1131 "", /* 11 (d32) */ 1132 "0.0625 * ", /* 12 (d16) */ 1133 "0.125 * ", /* 13 (d8) */ 1134 "0.25 * ", /* 14 (d4) */ 1135 "0.5 * " /* 15 (d2) */ 1117 "", /* 0 (none) */ 1118 "2.0 * ", /* 1 (x2) */ 1119 "4.0 * ", /* 2 (x4) */ 1120 "8.0 * ", /* 3 (x8) */ 1121 "16.0 * ", /* 4 (x16) */ 1122 "32.0 * ", /* 5 (x32) */ 1123 "", /* 6 (x64) */ 1124 "", /* 7 (x128) */ 1125 "", /* 8 (d256) */ 1126 "", /* 9 (d128) */ 1127 "", /* 10 (d64) */ 1128 "", /* 11 (d32) */ 1129 "0.0625 * ", /* 12 (d16) */ 1130 "0.125 * ", /* 13 (d8) */ 1131 "0.25 * ", /* 14 (d4) */ 1132 "0.5 * " /* 15 (d2) */ 1136 1133 }; 1137 1134 … … 1791 1788 1792 1789 /***************************************************************************** 1793 *1794 1790 * Begin processing individual instruction opcodes 1795 *1796 1791 ****************************************************************************/ 1797 1792 … … 2278 2273 } 2279 2274 2280 /* * Handles transforming all WINED3DSIO_M?x? opcodes for2281 2275 /* Handles transforming all WINED3DSIO_M?x? opcodes for 2276 Vertex shaders to GLSL codes */ 2282 2277 static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins) 2283 2278 { … … 2335 2330 2336 2331 /** 2337 The LRP instruction performs a component-wise linear interpolation 2332 The LRP instruction performs a component-wise linear interpolation 2338 2333 between the second and third operands using the first operand as the 2339 2334 blend factor. Equation: (dst = src2 + src0 * (src1 - src2)) … … 2432 2427 * VS 2.0 requires that specific cosine and sine constants be passed to this instruction so the hardware 2433 2428 * can handle it. But, these functions are built-in for GLSL, so we can just ignore the last 2 params. 2434 * 2429 * 2435 2430 * dst.x = cos(src0.?) 2436 2431 * dst.y = sin(src0.?) … … 2496 2491 } 2497 2492 2498 if(control_values) { 2499 if(control_values[2] > 0) { 2500 shader_addline(ins->ctx->buffer, "for (aL%u = %d; aL%u < (%d * %d + %d); aL%u += %d) {\n", 2501 shader->baseShader.cur_loop_depth, control_values[1], 2502 shader->baseShader.cur_loop_depth, control_values[0], control_values[2], control_values[1], 2503 shader->baseShader.cur_loop_depth, control_values[2]); 2504 } else if(control_values[2] == 0) { 2505 shader_addline(ins->ctx->buffer, "for (aL%u = %d, tmpInt%u = 0; tmpInt%u < %d; tmpInt%u++) {\n", 2506 shader->baseShader.cur_loop_depth, control_values[1], shader->baseShader.cur_loop_depth, 2507 shader->baseShader.cur_loop_depth, control_values[0], 2493 if (control_values) 2494 { 2495 struct wined3d_shader_loop_control loop_control; 2496 loop_control.count = control_values[0]; 2497 loop_control.start = control_values[1]; 2498 loop_control.step = (int)control_values[2]; 2499 2500 if (loop_control.step > 0) 2501 { 2502 shader_addline(ins->ctx->buffer, "for (aL%u = %u; aL%u < (%u * %d + %u); aL%u += %d) {\n", 2503 shader->baseShader.cur_loop_depth, loop_control.start, 2504 shader->baseShader.cur_loop_depth, loop_control.count, loop_control.step, loop_control.start, 2505 shader->baseShader.cur_loop_depth, loop_control.step); 2506 } 2507 else if (loop_control.step < 0) 2508 { 2509 shader_addline(ins->ctx->buffer, "for (aL%u = %u; aL%u > (%u * %d + %u); aL%u += %d) {\n", 2510 shader->baseShader.cur_loop_depth, loop_control.start, 2511 shader->baseShader.cur_loop_depth, loop_control.count, loop_control.step, loop_control.start, 2512 shader->baseShader.cur_loop_depth, loop_control.step); 2513 } 2514 else 2515 { 2516 shader_addline(ins->ctx->buffer, "for (aL%u = %u, tmpInt%u = 0; tmpInt%u < %u; tmpInt%u++) {\n", 2517 shader->baseShader.cur_loop_depth, loop_control.start, shader->baseShader.cur_loop_depth, 2518 shader->baseShader.cur_loop_depth, loop_control.count, 2508 2519 shader->baseShader.cur_loop_depth); 2509 } else {2510 shader_addline(ins->ctx->buffer, "for (aL%u = %d; aL%u > (%d * %d + %d); aL%u += %d) {\n",2511 shader->baseShader.cur_loop_depth, control_values[1],2512 shader->baseShader.cur_loop_depth, control_values[0], control_values[2], control_values[1],2513 shader->baseShader.cur_loop_depth, control_values[2]);2514 2520 } 2515 2521 } else { … … 2648 2654 * Pixel Shader Specific Code begins here 2649 2655 ********************************************/ 2650 static void pshader_glsl_tex(const struct wined3d_shader_instruction *ins)2656 static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) 2651 2657 { 2652 2658 IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader; … … 2751 2757 if(!GL_SUPPORT(ARB_SHADER_TEXTURE_LOD)) { 2752 2758 FIXME("texldd used, but not supported by hardware. Falling back to regular tex\n"); 2753 return pshader_glsl_tex(ins);2759 return shader_glsl_tex(ins); 2754 2760 } 2755 2761 … … 2774 2780 IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; 2775 2781 IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; 2782 const struct wined3d_gl_info *gl_info = &deviceImpl->adapter->gl_info; 2776 2783 glsl_sample_function_t sample_function; 2777 2784 glsl_src_param_t coord_param, lod_param; … … 2792 2799 shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_3, &lod_param); 2793 2800 2794 if (shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type)) 2801 if (!gl_info->supported[ARB_SHADER_TEXTURE_LOD] 2802 && shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type)) 2795 2803 { 2796 2804 /* The GLSL spec claims the Lod sampling functions are only supported in vertex shaders. … … 2802 2810 } 2803 2811 2804 static void pshader_glsl_texcoord(const struct wined3d_shader_instruction *ins)2812 static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins) 2805 2813 { 2806 2814 /* FIXME: Make this work for more than just 2D textures */ … … 2851 2859 * Take a 3-component dot product of the TexCoord[dstreg] and src, 2852 2860 * then perform a 1D texture lookup from stage dstregnum, place into dst. */ 2853 static void pshader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)2861 static void shader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins) 2854 2862 { 2855 2863 glsl_src_param_t src0_param; … … 2895 2903 /** Process the WINED3DSIO_TEXDP3 instruction in GLSL: 2896 2904 * Take a 3-component dot product of the TexCoord[dstreg] and src. */ 2897 static void pshader_glsl_texdp3(const struct wined3d_shader_instruction *ins)2905 static void shader_glsl_texdp3(const struct wined3d_shader_instruction *ins) 2898 2906 { 2899 2907 glsl_src_param_t src0_param; … … 2916 2924 /** Process the WINED3DSIO_TEXDEPTH instruction in GLSL: 2917 2925 * Calculate the depth as dst.x / dst.y */ 2918 static void pshader_glsl_texdepth(const struct wined3d_shader_instruction *ins)2926 static void shader_glsl_texdepth(const struct wined3d_shader_instruction *ins) 2919 2927 { 2920 2928 glsl_dst_param_t dst_param; … … 2937 2945 * depth = (tmp0.y == 0.0) ? 1.0 : tmp0.x / tmp0.y 2938 2946 */ 2939 static void pshader_glsl_texm3x2depth(const struct wined3d_shader_instruction *ins)2947 static void shader_glsl_texm3x2depth(const struct wined3d_shader_instruction *ins) 2940 2948 { 2941 2949 DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; … … 2951 2959 /** Process the WINED3DSIO_TEXM3X2PAD instruction in GLSL 2952 2960 * Calculate the 1st of a 2-row matrix multiplication. */ 2953 static void pshader_glsl_texm3x2pad(const struct wined3d_shader_instruction *ins)2961 static void shader_glsl_texm3x2pad(const struct wined3d_shader_instruction *ins) 2954 2962 { 2955 2963 DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; … … 2964 2972 /** Process the WINED3DSIO_TEXM3X3PAD instruction in GLSL 2965 2973 * Calculate the 1st or 2nd row of a 3-row matrix multiplication. */ 2966 static void pshader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins)2974 static void shader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins) 2967 2975 { 2968 2976 IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader; … … 2978 2986 } 2979 2987 2980 static void pshader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins)2988 static void shader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins) 2981 2989 { 2982 2990 DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; … … 2998 3006 /** Process the WINED3DSIO_TEXM3X3TEX instruction in GLSL 2999 3007 * Perform the 3rd row of a 3x3 matrix multiply, then sample the texture using the calculated coordinates */ 3000 static void pshader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins)3008 static void shader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins) 3001 3009 { 3002 3010 DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; … … 3022 3030 /** Process the WINED3DSIO_TEXM3X3 instruction in GLSL 3023 3031 * Perform the 3rd row of a 3x3 matrix multiply */ 3024 static void pshader_glsl_texm3x3(const struct wined3d_shader_instruction *ins)3032 static void shader_glsl_texm3x3(const struct wined3d_shader_instruction *ins) 3025 3033 { 3026 3034 DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; … … 3040 3048 } 3041 3049 3042 /* * Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL3050 /* Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL 3043 3051 * Perform the final texture lookup based on the previous 2 3x3 matrix multiplies */ 3044 static void pshader_glsl_texm3x3spec(const struct wined3d_shader_instruction *ins)3052 static void shader_glsl_texm3x3spec(const struct wined3d_shader_instruction *ins) 3045 3053 { 3046 3054 IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader; … … 3071 3079 } 3072 3080 3073 /* * Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL3081 /* Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL 3074 3082 * Perform the final texture lookup based on the previous 2 3x3 matrix multiplies */ 3075 static void pshader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *ins)3083 static void shader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *ins) 3076 3084 { 3077 3085 IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader; … … 3107 3115 * texbem is pshader <= 1.3 only, this saves a few version checks 3108 3116 */ 3109 static void pshader_glsl_texbem(const struct wined3d_shader_instruction *ins)3117 static void shader_glsl_texbem(const struct wined3d_shader_instruction *ins) 3110 3118 { 3111 3119 IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader; … … 3166 3174 } 3167 3175 3168 static void pshader_glsl_bem(const struct wined3d_shader_instruction *ins)3176 static void shader_glsl_bem(const struct wined3d_shader_instruction *ins) 3169 3177 { 3170 3178 glsl_src_param_t src0_param, src1_param; … … 3181 3189 /** Process the WINED3DSIO_TEXREG2AR instruction in GLSL 3182 3190 * Sample 2D texture at dst using the alpha & red (wx) components of src as texture coordinates */ 3183 static void pshader_glsl_texreg2ar(const struct wined3d_shader_instruction *ins)3191 static void shader_glsl_texreg2ar(const struct wined3d_shader_instruction *ins) 3184 3192 { 3185 3193 glsl_src_param_t src0_param; … … 3197 3205 /** Process the WINED3DSIO_TEXREG2GB instruction in GLSL 3198 3206 * Sample 2D texture at dst using the green & blue (yz) components of src as texture coordinates */ 3199 static void pshader_glsl_texreg2gb(const struct wined3d_shader_instruction *ins)3207 static void shader_glsl_texreg2gb(const struct wined3d_shader_instruction *ins) 3200 3208 { 3201 3209 glsl_src_param_t src0_param; … … 3213 3221 /** Process the WINED3DSIO_TEXREG2RGB instruction in GLSL 3214 3222 * Sample texture at dst using the rgb (xyz) components of src as texture coordinates */ 3215 static void pshader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins)3223 static void shader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins) 3216 3224 { 3217 3225 glsl_src_param_t src0_param; … … 3230 3238 /** Process the WINED3DSIO_TEXKILL instruction in GLSL. 3231 3239 * If any of the first 3 components are < 0, discard this pixel */ 3232 static void pshader_glsl_texkill(const struct wined3d_shader_instruction *ins)3240 static void shader_glsl_texkill(const struct wined3d_shader_instruction *ins) 3233 3241 { 3234 3242 glsl_dst_param_t dst_param; … … 3251 3259 /** Process the WINED3DSIO_DP2ADD instruction in GLSL. 3252 3260 * dst = dot2(src0, src1) + src2 */ 3253 static void pshader_glsl_dp2add(const struct wined3d_shader_instruction *ins)3261 static void shader_glsl_dp2add(const struct wined3d_shader_instruction *ins) 3254 3262 { 3255 3263 glsl_src_param_t src0_param; … … 3275 3283 } 3276 3284 3277 static void pshader_glsl_input_pack(IWineD3DPixelShader *iface, struct wined3d_shader_buffer *buffer,3285 static void shader_glsl_input_pack(IWineD3DPixelShader *iface, struct wined3d_shader_buffer *buffer, 3278 3286 const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps, 3279 3287 enum vertexprocessing_mode vertexprocessing) … … 3740 3748 if (reg_maps->shader_version.major >= 3 && args->vp_mode != vertexshader) 3741 3749 { 3742 pshader_glsl_input_pack((IWineD3DPixelShader *) This, buffer, This->input_signature, reg_maps, args->vp_mode);3750 shader_glsl_input_pack((IWineD3DPixelShader *) This, buffer, This->input_signature, reg_maps, args->vp_mode); 3743 3751 } 3744 3752 … … 3883 3891 GLhandleARB ret; 3884 3892 3885 if(!shader->backend_priv) { 3886 shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 3887 } 3888 shader_data = shader->backend_priv; 3893 if (!shader->baseShader.backend_data) 3894 { 3895 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 3896 if (!shader->baseShader.backend_data) 3897 { 3898 ERR("Failed to allocate backend data.\n"); 3899 return 0; 3900 } 3901 } 3902 shader_data = shader->baseShader.backend_data; 3889 3903 3890 3904 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2), … … 3952 3966 GLhandleARB ret; 3953 3967 3954 if(!shader->backend_priv) { 3955 shader->backend_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 3956 } 3957 shader_data = shader->backend_priv; 3968 if (!shader->baseShader.backend_data) 3969 { 3970 shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data)); 3971 if (!shader->baseShader.backend_data) 3972 { 3973 ERR("Failed to allocate backend data.\n"); 3974 return 0; 3975 } 3976 } 3977 shader_data = shader->baseShader.backend_data; 3958 3978 3959 3979 /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2), … … 4354 4374 struct glsl_pshader_private *shader_data; 4355 4375 ps = (IWineD3DPixelShaderImpl *) This; 4356 shader_data = ps->ba ckend_priv;4376 shader_data = ps->baseShader.backend_data; 4357 4377 if(!shader_data || shader_data->num_gl_shaders == 0) 4358 4378 { 4359 4379 HeapFree(GetProcessHeap(), 0, shader_data); 4360 ps->ba ckend_priv= NULL;4380 ps->baseShader.backend_data = NULL; 4361 4381 return; 4362 4382 } … … 4374 4394 struct glsl_vshader_private *shader_data; 4375 4395 vs = (IWineD3DVertexShaderImpl *) This; 4376 shader_data = vs->ba ckend_priv;4396 shader_data = vs->baseShader.backend_data; 4377 4397 if(!shader_data || shader_data->num_gl_shaders == 0) 4378 4398 { 4379 4399 HeapFree(GetProcessHeap(), 0, shader_data); 4380 vs->ba ckend_priv= NULL;4400 vs->baseShader.backend_data = NULL; 4381 4401 return; 4382 4402 } … … 4414 4434 if(pshader) { 4415 4435 UINT i; 4416 struct glsl_pshader_private *shader_data = ps->ba ckend_priv;4436 struct glsl_pshader_private *shader_data = ps->baseShader.backend_data; 4417 4437 4418 4438 ENTER_GL(); … … 4425 4445 HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders); 4426 4446 HeapFree(GetProcessHeap(), 0, shader_data); 4427 ps->ba ckend_priv= NULL;4447 ps->baseShader.backend_data = NULL; 4428 4448 } else { 4429 4449 UINT i; 4430 struct glsl_vshader_private *shader_data = vs->ba ckend_priv;4450 struct glsl_vshader_private *shader_data = vs->baseShader.backend_data; 4431 4451 4432 4452 ENTER_GL(); … … 4439 4459 HeapFree(GetProcessHeap(), 0, shader_data->gl_shaders); 4440 4460 HeapFree(GetProcessHeap(), 0, shader_data); 4441 vs->ba ckend_priv= NULL;4461 vs->baseShader.backend_data = NULL; 4442 4462 } 4443 4463 } … … 4580 4600 { 4581 4601 /* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati 4582 * models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support using4583 * vs_nv_version which is based onNV_vertex_program.4602 * models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support based 4603 * on the version of NV_vertex_program. 4584 4604 * For Ati cards there's no way using glsl (it abstracts the lowlevel info away) and also not 4585 4605 * using ARB_vertex_program. It is safe to assume that when a card supports pixel shader 2.0 it … … 4587 4607 * of native instructions, so use that here. For more info see the pixel shader versioning code below. 4588 4608 */ 4589 if((GLINFO_LOCATION.vs_nv_version == VS_VERSION_20) || (GLINFO_LOCATION.ps_arb_max_instructions <= 512)) 4609 if ((gl_info->supported[NV_VERTEX_PROGRAM2] && !gl_info->supported[NV_VERTEX_PROGRAM3]) 4610 || gl_info->ps_arb_max_instructions <= 512) 4590 4611 pCaps->VertexShaderVersion = WINED3DVS_VERSION(2,0); 4591 4612 else … … 4605 4626 * NOTE: ps3.0 hardware requires 512 or more instructions but ati and nvidia offer 'enough' (1024 vs 4096) on their most basic ps3.0 hardware. 4606 4627 */ 4607 if((GLINFO_LOCATION.ps_nv_version == PS_VERSION_20) || (GLINFO_LOCATION.ps_arb_max_instructions <= 512)) 4628 if ((gl_info->supported[NV_FRAGMENT_PROGRAM] && !gl_info->supported[NV_FRAGMENT_PROGRAM2]) 4629 || (gl_info->ps_arb_max_instructions <= 512)) 4608 4630 pCaps->PixelShaderVersion = WINED3DPS_VERSION(2,0); 4609 4631 else … … 4653 4675 /* WINED3DSIH_ABS */ shader_glsl_map2gl, 4654 4676 /* WINED3DSIH_ADD */ shader_glsl_arith, 4655 /* WINED3DSIH_BEM */ pshader_glsl_bem,4677 /* WINED3DSIH_BEM */ shader_glsl_bem, 4656 4678 /* WINED3DSIH_BREAK */ shader_glsl_break, 4657 4679 /* WINED3DSIH_BREAKC */ shader_glsl_breakc, … … 4666 4688 /* WINED3DSIH_DEFB */ NULL, 4667 4689 /* WINED3DSIH_DEFI */ NULL, 4668 /* WINED3DSIH_DP2ADD */ pshader_glsl_dp2add,4690 /* WINED3DSIH_DP2ADD */ shader_glsl_dp2add, 4669 4691 /* WINED3DSIH_DP3 */ shader_glsl_dot, 4670 4692 /* WINED3DSIH_DP4 */ shader_glsl_dot, … … 4712 4734 /* WINED3DSIH_SLT */ shader_glsl_compare, 4713 4735 /* WINED3DSIH_SUB */ shader_glsl_arith, 4714 /* WINED3DSIH_TEX */ pshader_glsl_tex,4715 /* WINED3DSIH_TEXBEM */ pshader_glsl_texbem,4716 /* WINED3DSIH_TEXBEML */ pshader_glsl_texbem,4717 /* WINED3DSIH_TEXCOORD */ pshader_glsl_texcoord,4718 /* WINED3DSIH_TEXDEPTH */ pshader_glsl_texdepth,4719 /* WINED3DSIH_TEXDP3 */ pshader_glsl_texdp3,4720 /* WINED3DSIH_TEXDP3TEX */ pshader_glsl_texdp3tex,4721 /* WINED3DSIH_TEXKILL */ pshader_glsl_texkill,4736 /* WINED3DSIH_TEX */ shader_glsl_tex, 4737 /* WINED3DSIH_TEXBEM */ shader_glsl_texbem, 4738 /* WINED3DSIH_TEXBEML */ shader_glsl_texbem, 4739 /* WINED3DSIH_TEXCOORD */ shader_glsl_texcoord, 4740 /* WINED3DSIH_TEXDEPTH */ shader_glsl_texdepth, 4741 /* WINED3DSIH_TEXDP3 */ shader_glsl_texdp3, 4742 /* WINED3DSIH_TEXDP3TEX */ shader_glsl_texdp3tex, 4743 /* WINED3DSIH_TEXKILL */ shader_glsl_texkill, 4722 4744 /* WINED3DSIH_TEXLDD */ shader_glsl_texldd, 4723 4745 /* WINED3DSIH_TEXLDL */ shader_glsl_texldl, 4724 /* WINED3DSIH_TEXM3x2DEPTH */ pshader_glsl_texm3x2depth,4725 /* WINED3DSIH_TEXM3x2PAD */ pshader_glsl_texm3x2pad,4726 /* WINED3DSIH_TEXM3x2TEX */ pshader_glsl_texm3x2tex,4727 /* WINED3DSIH_TEXM3x3 */ pshader_glsl_texm3x3,4746 /* WINED3DSIH_TEXM3x2DEPTH */ shader_glsl_texm3x2depth, 4747 /* WINED3DSIH_TEXM3x2PAD */ shader_glsl_texm3x2pad, 4748 /* WINED3DSIH_TEXM3x2TEX */ shader_glsl_texm3x2tex, 4749 /* WINED3DSIH_TEXM3x3 */ shader_glsl_texm3x3, 4728 4750 /* WINED3DSIH_TEXM3x3DIFF */ NULL, 4729 /* WINED3DSIH_TEXM3x3PAD */ pshader_glsl_texm3x3pad,4730 /* WINED3DSIH_TEXM3x3SPEC */ pshader_glsl_texm3x3spec,4731 /* WINED3DSIH_TEXM3x3TEX */ pshader_glsl_texm3x3tex,4732 /* WINED3DSIH_TEXM3x3VSPEC */ pshader_glsl_texm3x3vspec,4733 /* WINED3DSIH_TEXREG2AR */ pshader_glsl_texreg2ar,4734 /* WINED3DSIH_TEXREG2GB */ pshader_glsl_texreg2gb,4735 /* WINED3DSIH_TEXREG2RGB */ pshader_glsl_texreg2rgb,4751 /* WINED3DSIH_TEXM3x3PAD */ shader_glsl_texm3x3pad, 4752 /* WINED3DSIH_TEXM3x3SPEC */ shader_glsl_texm3x3spec, 4753 /* WINED3DSIH_TEXM3x3TEX */ shader_glsl_texm3x3tex, 4754 /* WINED3DSIH_TEXM3x3VSPEC */ shader_glsl_texm3x3vspec, 4755 /* WINED3DSIH_TEXREG2AR */ shader_glsl_texreg2ar, 4756 /* WINED3DSIH_TEXREG2GB */ shader_glsl_texreg2gb, 4757 /* WINED3DSIH_TEXREG2RGB */ shader_glsl_texreg2rgb, 4736 4758 }; 4737 4759 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/pixelshader.c
r22496 r23571 8 8 * Copyright 2006 Ivan Gyurdiev 9 9 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 10 * Copyright 2009 Henri Verbeet for CodeWeavers 10 11 * 11 12 * This library is free software; you can redistribute it and/or … … 81 82 { 82 83 shader_cleanup((IWineD3DBaseShader *)iface); 84 This->baseShader.parent_ops->wined3d_object_destroyed(This->baseShader.parent); 83 85 HeapFree(GetProcessHeap(), 0, This); 84 86 } … … 94 96 IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)iface; 95 97 96 *parent = This-> parent;98 *parent = This->baseShader.parent; 97 99 IUnknown_AddRef(*parent); 98 100 TRACE("(%p) : returning %p\n", This, *parent); … … 218 220 } 219 221 220 static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface,221 const DWORD * pFunction, const struct wined3d_shader_signature *output_signature)222 static HRESULT pixelshader_set_function(IWineD3DPixelShaderImpl *shader, 223 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature) 222 224 { 223 IWineD3DPixelShaderImpl *This =(IWineD3DPixelShaderImpl *)iface; 225 IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device; 226 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 224 227 unsigned int i, highest_reg_used = 0, num_regs_used = 0; 225 shader_reg_maps *reg_maps = & This->baseShader.reg_maps;228 shader_reg_maps *reg_maps = &shader->baseShader.reg_maps; 226 229 const struct wined3d_shader_frontend *fe; 227 230 HRESULT hr; 228 231 229 TRACE(" (%p) : pFunction %p\n", iface, pFunction);230 231 fe = shader_select_frontend(* pFunction);232 TRACE("shader %p, byte_code %p, output_signature %p.\n", shader, byte_code, output_signature); 233 234 fe = shader_select_frontend(*byte_code); 232 235 if (!fe) 233 236 { … … 235 238 return WINED3DERR_INVALIDCALL; 236 239 } 237 This->baseShader.frontend = fe;238 This->baseShader.frontend_data = fe->shader_init(pFunction, output_signature);239 if (! This->baseShader.frontend_data)240 shader->baseShader.frontend = fe; 241 shader->baseShader.frontend_data = fe->shader_init(byte_code, output_signature); 242 if (!shader->baseShader.frontend_data) 240 243 { 241 244 FIXME("Failed to initialize frontend.\n"); … … 244 247 245 248 /* First pass: trace shader */ 246 if (TRACE_ON(d3d_shader)) shader_trace_init(fe, This->baseShader.frontend_data, pFunction);249 if (TRACE_ON(d3d_shader)) shader_trace_init(fe, shader->baseShader.frontend_data, byte_code); 247 250 248 251 /* Initialize immediate constant lists */ 249 list_init(& This->baseShader.constantsF);250 list_init(& This->baseShader.constantsB);251 list_init(& This->baseShader.constantsI);252 list_init(&shader->baseShader.constantsF); 253 list_init(&shader->baseShader.constantsB); 254 list_init(&shader->baseShader.constantsI); 252 255 253 256 /* Second pass: figure out which registers are used, what the semantics are, etc.. */ 254 hr = shader_get_registers_used((IWineD3DBaseShader *) This, fe,255 reg_maps, NULL, This->input_signature, NULL,256 pFunction, GL_LIMITS(pshader_constantsF));257 hr = shader_get_registers_used((IWineD3DBaseShader *)shader, fe, 258 reg_maps, NULL, shader->input_signature, NULL, 259 byte_code, gl_info->max_pshader_constantsF); 257 260 if (FAILED(hr)) return hr; 258 261 259 pshader_set_limits( This);262 pshader_set_limits(shader); 260 263 261 264 for (i = 0; i < MAX_REG_INPUT; ++i) 262 265 { 263 if ( This->input_reg_used[i])266 if (shader->input_reg_used[i]) 264 267 { 265 268 ++num_regs_used; … … 270 273 /* Don't do any register mapping magic if it is not needed, or if we can't 271 274 * achieve anything anyway */ 272 if (highest_reg_used < ( GL_LIMITS(glsl_varyings)/ 4)273 || num_regs_used > ( GL_LIMITS(glsl_varyings)/ 4))274 { 275 if (num_regs_used > ( GL_LIMITS(glsl_varyings)/ 4))275 if (highest_reg_used < (gl_info->max_glsl_varyings / 4) 276 || num_regs_used > (gl_info->max_glsl_varyings / 4)) 277 { 278 if (num_regs_used > (gl_info->max_glsl_varyings / 4)) 276 279 { 277 280 /* This happens with relative addressing. The input mapper function … … 283 286 for (i = 0; i < MAX_REG_INPUT; ++i) 284 287 { 285 This->input_reg_map[i] = i;286 } 287 288 This->declared_in_count = highest_reg_used + 1;288 shader->input_reg_map[i] = i; 289 } 290 291 shader->declared_in_count = highest_reg_used + 1; 289 292 } 290 293 else 291 294 { 292 This->declared_in_count = 0;295 shader->declared_in_count = 0; 293 296 for (i = 0; i < MAX_REG_INPUT; ++i) 294 297 { 295 if ( This->input_reg_used[i]) This->input_reg_map[i] = This->declared_in_count++;296 else This->input_reg_map[i] = ~0U;297 } 298 } 299 300 This->baseShader.load_local_constsF = FALSE;301 302 TRACE("(%p) : Copying the function\n", This);303 304 This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength);305 if (! This->baseShader.function) return E_OUTOFMEMORY;306 memcpy( This->baseShader.function, pFunction, This->baseShader.functionLength);298 if (shader->input_reg_used[i]) shader->input_reg_map[i] = shader->declared_in_count++; 299 else shader->input_reg_map[i] = ~0U; 300 } 301 } 302 303 shader->baseShader.load_local_constsF = FALSE; 304 305 TRACE("(%p) : Copying byte code.\n", shader); 306 307 shader->baseShader.function = HeapAlloc(GetProcessHeap(), 0, shader->baseShader.functionLength); 308 if (!shader->baseShader.function) return E_OUTOFMEMORY; 309 memcpy(shader->baseShader.function, byte_code, shader->baseShader.functionLength); 307 310 308 311 return WINED3D_OK; … … 353 356 } 354 357 355 const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =358 static const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl = 356 359 { 357 360 /*** IUnknown methods ***/ … … 362 365 IWineD3DPixelShaderImpl_GetParent, 363 366 /*** IWineD3DBaseShader methods ***/ 364 IWineD3DPixelShaderImpl_SetFunction,365 /*** IWineD3DPixelShader methods ***/366 367 IWineD3DPixelShaderImpl_GetDevice, 367 368 IWineD3DPixelShaderImpl_GetFunction 369 /*** IWineD3DPixelShader methods ***/ 368 370 }; 369 371 … … 431 433 } 432 434 } 435 436 HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device, 437 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, 438 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 439 { 440 HRESULT hr; 441 442 if (!byte_code) return WINED3DERR_INVALIDCALL; 443 444 shader->lpVtbl = &IWineD3DPixelShader_Vtbl; 445 shader_init(&shader->baseShader, device, parent, parent_ops); 446 447 hr = pixelshader_set_function(shader, byte_code, output_signature); 448 if (FAILED(hr)) 449 { 450 WARN("Failed to set function, hr %#x.\n", hr); 451 shader_cleanup((IWineD3DBaseShader *)shader); 452 return hr; 453 } 454 455 return WINED3D_OK; 456 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/query.c
r22496 r23571 356 356 if (!pData || !dwSize) return S_OK; 357 357 358 if (!query->context) 359 { 360 ERR("Query not started, returning TRUE.\n"); 361 *data = TRUE; 362 363 return S_OK; 364 } 365 358 366 if (query->context->tid != GetCurrentThreadId()) 359 367 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/resource.c
r20612 r23571 6 6 * Copyright 2004 Christian Costa 7 7 * Copyright 2005 Oliver Stieber 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 38 39 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 39 40 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc, 40 WINED3DPOOL pool, IUnknown *parent )41 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 41 42 { 42 43 struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource; … … 51 52 resource->size = size; 52 53 resource->priority = 0; 54 resource->parent_ops = parent_ops; 53 55 list_init(&resource->privateData); 54 56 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/shader_sm4.c
r22496 r23571 63 63 WINED3D_SM4_OP_EXP = 0x19, 64 64 WINED3D_SM4_OP_LOG = 0x2f, 65 WINED3D_SM4_OP_MIN = 0x33, 66 WINED3D_SM4_OP_MAX = 0x34, 65 67 WINED3D_SM4_OP_MOV = 0x36, 66 68 WINED3D_SM4_OP_MUL = 0x38, … … 114 116 {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, 1, 1}, 115 117 {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, 1, 1}, 118 {WINED3D_SM4_OP_MIN, WINED3DSIH_MIN, 1, 2}, 119 {WINED3D_SM4_OP_MAX, WINED3DSIH_MAX, 1, 2}, 116 120 {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, 1, 1}, 117 121 {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, 1, 2}, -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/state.c
r22496 r23571 9 9 * Copyright 2006 Henri Verbeet 10 10 * Copyright 2006-2008 Stefan Dösinger for CodeWeavers 11 * Copyright 2009 Henri Verbeet for CodeWeavers 11 12 * 12 13 * This library is free software; you can redistribute it and/or … … 44 45 WINE_DECLARE_DEBUG_CHANNEL(d3d_shader); 45 46 46 #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info47 #define GLINFO_LOCATION (*context->gl_info) 47 48 48 49 /* GL locking for state handlers is done by the caller. */ … … 66 67 static void state_undefined(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) 67 68 { 68 /* Print a WARN, this allows the stateblock code to loop over all states to generate a display 69 * list without causing confusing terminal output. Deliberately no special debug name here 70 * because its undefined. 71 */ 72 WARN("undefined state %d\n", state); 69 ERR("Undefined state.\n"); 73 70 } 74 71 … … 578 575 enable = stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]; 579 576 disable = ~stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]; 580 if(GL_SUPPORT(NV_DEPTH_CLAMP)) { 581 glDisable(GL_DEPTH_CLAMP_NV); 582 checkGLcall("glDisable(GL_DEPTH_CLAMP_NV)"); 577 if (GL_SUPPORT(ARB_DEPTH_CLAMP)) 578 { 579 glDisable(GL_DEPTH_CLAMP); 580 checkGLcall("glDisable(GL_DEPTH_CLAMP)"); 583 581 } 584 582 } else { 585 583 disable = 0xffffffff; 586 584 enable = 0x00; 587 if(GL_SUPPORT(NV_DEPTH_CLAMP)) { 588 glEnable(GL_DEPTH_CLAMP_NV); 589 checkGLcall("glEnable(GL_DEPTH_CLAMP_NV)"); 585 if (GL_SUPPORT(ARB_DEPTH_CLAMP)) 586 { 587 glEnable(GL_DEPTH_CLAMP); 588 checkGLcall("glEnable(GL_DEPTH_CLAMP)"); 590 589 } 591 590 } … … 785 784 } 786 785 787 static void 788 renderstate_stencil_twosided(IWineD3DStateBlockImpl *stateblock, GLint face, GLint func, GLint ref, GLuint mask, GLint stencilFail, GLint depthFail, GLint stencilPass ) { 786 static void renderstate_stencil_twosided(struct wined3d_context *context, GLint face, 787 GLint func, GLint ref, GLuint mask, GLint stencilFail, GLint depthFail, GLint stencilPass) 788 { 789 789 glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT); 790 790 checkGLcall("glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)"); … … 852 852 * to set it back 853 853 */ 854 renderstate_stencil_twosided( stateblock, GL_BACK, func_ccw, ref, mask,855 856 renderstate_stencil_twosided( stateblock, GL_FRONT, func, ref, mask,857 854 renderstate_stencil_twosided(context, GL_BACK, 855 func_ccw, ref, mask, stencilFail_ccw, depthFail_ccw, stencilPass_ccw); 856 renderstate_stencil_twosided(context, GL_FRONT, 857 func, ref, mask, stencilFail, depthFail, stencilPass); 858 858 } else if(GL_SUPPORT(ATI_SEPARATE_STENCIL)) { 859 859 GL_EXTCALL(glStencilFuncSeparateATI(func, func_ccw, ref, mask)); … … 1191 1191 IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; 1192 1192 GLenum Parm = 0; 1193 const struct wined3d_stream_info_element *diffuse = &device->strided_streams.elements[WINED3D_FFP_DIFFUSE];1194 BOOL isDiffuseSupplied;1195 1193 1196 1194 /* Depends on the decoded vertex declaration to read the existence of diffuse data. … … 1202 1200 } 1203 1201 1204 isDiffuseSupplied = diffuse->data || diffuse->buffer_object;1205 1206 1202 context->num_untracked_materials = 0; 1207 if (isDiffuseSupplied && stateblock->renderState[WINED3DRS_COLORVERTEX]) { 1203 if ((device->strided_streams.use_map & (1 << WINED3D_FFP_DIFFUSE)) 1204 && stateblock->renderState[WINED3DRS_COLORVERTEX]) 1205 { 1208 1206 TRACE("diff %d, amb %d, emis %d, spec %d\n", 1209 1207 stateblock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE], … … 1360 1358 */ 1361 1359 if (stateblock->renderState[WINED3DRS_NORMALIZENORMALS] 1362 && (stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_NORMAL].data 1363 || stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_NORMAL].buffer_object)) 1360 && (stateblock->wineD3DDevice->strided_streams.use_map & (1 << WINED3D_FFP_NORMAL))) 1364 1361 { 1365 1362 glEnable(GL_NORMALIZE); … … 1504 1501 } 1505 1502 1503 static void state_debug_monitor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) 1504 { 1505 WARN("token: %#x\n", stateblock->renderState[WINED3DRS_DEBUGMONITORTOKEN]); 1506 } 1507 1506 1508 static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) 1507 1509 { … … 1852 1854 } 1853 1855 1856 static void state_swvp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) 1857 { 1858 if (stateblock->renderState[WINED3DRS_SOFTWAREVERTEXPROCESSING]) 1859 { 1860 FIXME("Software vertex processing not implemented.\n"); 1861 } 1862 } 1863 1854 1864 /* Set texture operations up - The following avoids lots of ifdefs in this routine!*/ 1855 1865 #if defined (GL_VERSION_1_3) … … 1900 1910 1901 1911 /* Setup the texture operations texture stage states */ 1902 static void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) 1912 static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *iface, 1913 BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) 1903 1914 { 1904 1915 GLenum src1, src2, src3; … … 1911 1922 BOOL Handled = FALSE; 1912 1923 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; 1913 IWineD3DStateBlockImpl *stateblock = This->stateBlock; /* for GLINFO_LOCATION */1914 1924 1915 1925 TRACE("Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage, debug_d3dtop(op), arg1, arg2, arg3); … … 2977 2987 } 2978 2988 2979 set_tex_op( (IWineD3DDevice *)stateblock->wineD3DDevice, FALSE, stage,2989 set_tex_op(context, (IWineD3DDevice *)stateblock->wineD3DDevice, FALSE, stage, 2980 2990 stateblock->textureState[stage][WINED3DTSS_COLOROP], 2981 2991 stateblock->textureState[stage][WINED3DTSS_COLORARG1], … … 3079 3089 stateblock->textureState[stage][WINED3DTSS_RESULTARG]); 3080 3090 } else { 3081 set_tex_op( (IWineD3DDevice *)stateblock->wineD3DDevice, TRUE, stage,3091 set_tex_op(context, (IWineD3DDevice *)stateblock->wineD3DDevice, TRUE, stage, 3082 3092 op, arg1, arg2, arg0); 3083 3093 } … … 3110 3120 set_texture_matrix(&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0], 3111 3121 stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS], generated, context->last_was_rhw, 3112 stateblock->wineD3DDevice->strided_streams. elements[WINED3D_FFP_TEXCOORD0 + coordIdx].stride3122 stateblock->wineD3DDevice->strided_streams.use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coordIdx)) 3113 3123 ? stateblock->wineD3DDevice->strided_streams.elements[WINED3D_FFP_TEXCOORD0 + coordIdx].format_desc->format 3114 3124 : WINED3DFMT_UNKNOWN, … … 3130 3140 } 3131 3141 3132 static void unloadTexCoords(IWineD3DStateBlockImpl *stateblock) { 3142 static void unloadTexCoords(const struct wined3d_context *context) 3143 { 3133 3144 unsigned int texture_idx; 3134 3145 … … 3139 3150 } 3140 3151 3141 static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const struct wined3d_stream_info *si, GLuint *curVBO) 3152 static void loadTexCoords(const struct wined3d_context *context, IWineD3DStateBlockImpl *stateblock, 3153 const struct wined3d_stream_info *si, GLuint *curVBO) 3142 3154 { 3143 3155 const UINT *offset = stateblock->streamOffset; … … 3147 3159 for (textureNo = 0; textureNo < GL_LIMITS(texture_stages); ++textureNo) { 3148 3160 int coordIdx = stateblock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; 3149 const struct wined3d_stream_info_element *e;3150 3161 3151 3162 mapped_stage = stateblock->wineD3DDevice->texUnitMap[textureNo]; 3152 3163 if (mapped_stage == WINED3D_UNMAPPED_STAGE) continue; 3153 3164 3154 e = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx]; 3155 if (coordIdx < MAX_TEXTURES && (e->data || e->buffer_object)) 3165 if (coordIdx < MAX_TEXTURES && (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coordIdx)))) 3156 3166 { 3167 const struct wined3d_stream_info_element *e = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx]; 3168 3157 3169 TRACE("Setting up texture %u, idx %d, cordindx %u, data %p\n", 3158 3170 textureNo, mapped_stage, coordIdx, e->data); … … 3355 3367 GLuint curVBO = GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) ? ~0U : 0; 3356 3368 3357 unloadTexCoords( stateblock);3358 loadTexCoords( stateblock, &stateblock->wineD3DDevice->strided_streams, &curVBO);3369 unloadTexCoords(context); 3370 loadTexCoords(context, stateblock, &stateblock->wineD3DDevice->strided_streams, &curVBO); 3359 3371 } 3360 3372 } … … 3379 3391 DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); 3380 3392 3381 if(stateblock->pixelShader && stage != 0 && 3382 ((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.luminanceparams[stage]) { 3393 if (stateblock->pixelShader && stage != 0 3394 && (((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.reg_maps.luminanceparams & (1 << stage))) 3395 { 3383 3396 /* The pixel shader has to know the luminance scale. Do a constants update if it 3384 3397 * isn't scheduled anyway … … 3540 3553 { 3541 3554 DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); 3542 if(stateblock->pixelShader && stage != 0 && 3543 ((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.bumpmat[stage]) { 3555 if (stateblock->pixelShader && stage != 0 3556 && (((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.reg_maps.bumpmat & (1 << stage))) 3557 { 3544 3558 /* The pixel shader has to know the bump env matrix. Do a constants update if it isn't scheduled 3545 3559 * anyway … … 3842 3856 3843 3857 /* Window Coord 0 is the middle of the first pixel, so translate by 1/2 pixels */ 3844 glTranslatef(0.5f, 0.5f, 0.0f); 3845 checkGLcall("glTranslatef(0.5f, 0.5f, 0.0f)"); 3858 glTranslatef(63.0f / 128.0f, 63.0f / 128.0f, 0.0f); 3859 checkGLcall("glTranslatef(63.0f / 128.0f, 63.0f / 128.0f, 0.0f)"); 3860 3846 3861 /* D3D texture coordinates are flipped compared to OpenGL ones, so 3847 3862 * render everything upside down when rendering offscreen. */ … … 3889 3904 */ 3890 3905 3906 /* Translate by slightly less than a half pixel to force a top-left 3907 * filling convention. We want the difference to be large enough that 3908 * it doesn't get lost due to rounding inside the driver, but small 3909 * enough to prevent it from interfering with any anti-aliasing. */ 3910 GLfloat xoffset = (63.0f / 64.0f) / stateblock->viewport.Width; 3911 GLfloat yoffset = -(63.0f / 64.0f) / stateblock->viewport.Height; 3912 3891 3913 if (context->render_offscreen) 3892 3914 { 3893 3915 /* D3D texture coordinates are flipped compared to OpenGL ones, so 3894 3916 * render everything upside down when rendering offscreen. */ 3895 glTranslatef( 1.0f / stateblock->viewport.Width, 1.0f / stateblock->viewport.Height, -1.0f);3896 checkGLcall("glTranslatef( 1.0f / width, 1.0f / height, -1.0f)");3917 glTranslatef(xoffset, -yoffset, -1.0f); 3918 checkGLcall("glTranslatef(xoffset, -yoffset, -1.0f)"); 3897 3919 glScalef(1.0f, -1.0f, 2.0f); 3898 3920 } else { 3899 glTranslatef( 1.0f / stateblock->viewport.Width, -1.0f / stateblock->viewport.Height, -1.0f);3900 checkGLcall("glTranslatef( 1.0f / width, -1.0f / height, -1.0f)");3921 glTranslatef(xoffset, yoffset, -1.0f); 3922 checkGLcall("glTranslatef(xoffset, yoffset, -1.0f)"); 3901 3923 glScalef(1.0f, 1.0f, 2.0f); 3902 3924 } … … 3912 3934 * TODO: Only load / unload arrays if we have to. 3913 3935 */ 3914 static inline void unloadVertexData(IWineD3DStateBlockImpl *stateblock) { 3936 static inline void unloadVertexData(const struct wined3d_context *context) 3937 { 3915 3938 glDisableClientState(GL_VERTEX_ARRAY); 3916 3939 glDisableClientState(GL_NORMAL_ARRAY); … … 3922 3945 glDisableClientState(GL_WEIGHT_ARRAY_ARB); 3923 3946 } 3924 unloadTexCoords( stateblock);3947 unloadTexCoords(context); 3925 3948 } 3926 3949 … … 4056 4079 GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr)); 4057 4080 break; 4058 case WINED3DFMT_ A8R8G8B8:4081 case WINED3DFMT_B8G8R8A8_UNORM: 4059 4082 if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)) 4060 4083 { … … 4127 4150 4128 4151 /* Used from 2 different functions, and too big to justify making it inlined */ 4129 static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const struct wined3d_stream_info *si) 4152 static void loadVertexData(const struct wined3d_context *context, IWineD3DStateBlockImpl *stateblock, 4153 const struct wined3d_stream_info *si) 4130 4154 { 4131 4155 const UINT *offset = stateblock->streamOffset; … … 4139 4163 4140 4164 /* Blend Data ---------------------------------------------- */ 4141 e = &si->elements[WINED3D_FFP_BLENDWEIGHT]; 4142 if (e->data || e->buffer_object 4143 || si->elements[WINED3D_FFP_BLENDINDICES].data 4144 || si->elements[WINED3D_FFP_BLENDINDICES].buffer_object) 4165 if ((si->use_map & (1 << WINED3D_FFP_BLENDWEIGHT)) 4166 || si->use_map & (1 << WINED3D_FFP_BLENDINDICES)) 4145 4167 { 4168 e = &si->elements[WINED3D_FFP_BLENDWEIGHT]; 4169 4146 4170 if (GL_SUPPORT(ARB_VERTEX_BLEND)) { 4147 4171 TRACE("Blend %d %p %d\n", e->format_desc->component_count, … … 4170 4194 checkGLcall("glWeightPointerARB"); 4171 4195 4172 if (si->elements[WINED3D_FFP_BLENDINDICES].data 4173 || (si->elements[WINED3D_FFP_BLENDINDICES].buffer_object)) 4196 if (si->use_map & (1 << WINED3D_FFP_BLENDINDICES)) 4174 4197 { 4175 4198 static BOOL warned; … … 4195 4218 4196 4219 /* Point Size ----------------------------------------------*/ 4197 e = &si->elements[WINED3D_FFP_PSIZE]; 4198 if (e->data || e->buffer_object) 4220 if (si->use_map & (1 << WINED3D_FFP_PSIZE)) 4199 4221 { 4200 4222 /* no such functionality in the fixed function GL pipeline */ … … 4204 4226 4205 4227 /* Vertex Pointers -----------------------------------------*/ 4206 e = &si->elements[WINED3D_FFP_POSITION]; 4207 if (e->data || e->buffer_object) 4228 if (si->use_map & (1 << WINED3D_FFP_POSITION)) 4208 4229 { 4209 4230 VTRACE(("glVertexPointer(%d, GL_FLOAT, %d, %p)\n", e->stride, e->size, e->data)); 4210 4231 4232 e = &si->elements[WINED3D_FFP_POSITION]; 4211 4233 if (curVBO != e->buffer_object) 4212 4234 { … … 4238 4260 4239 4261 /* Normals -------------------------------------------------*/ 4240 e = &si->elements[WINED3D_FFP_NORMAL]; 4241 if (e->data || e->buffer_object) 4262 if (si->use_map & (1 << WINED3D_FFP_NORMAL)) 4242 4263 { 4243 4264 VTRACE(("glNormalPointer(GL_FLOAT, %d, %p)\n", e->stride, e->data)); 4265 4266 e = &si->elements[WINED3D_FFP_NORMAL]; 4244 4267 if (curVBO != e->buffer_object) 4245 4268 { … … 4268 4291 /* , or the user doesn't care and wants the speed advantage */ 4269 4292 4270 e = &si->elements[WINED3D_FFP_DIFFUSE]; 4271 if (e->data || e->buffer_object) 4293 if (si->use_map & (1 << WINED3D_FFP_DIFFUSE)) 4272 4294 { 4273 4295 VTRACE(("glColorPointer(4, GL_UNSIGNED_BYTE, %d, %p)\n", e->stride, e->data)); 4274 4296 4297 e = &si->elements[WINED3D_FFP_DIFFUSE]; 4275 4298 if (curVBO != e->buffer_object) 4276 4299 { … … 4292 4315 4293 4316 /* Specular Colour ------------------------------------------*/ 4294 e = &si->elements[WINED3D_FFP_SPECULAR]; 4295 if (e->data || e->buffer_object) 4317 if (si->use_map & (1 << WINED3D_FFP_SPECULAR)) 4296 4318 { 4297 4319 TRACE("setting specular colour\n"); 4298 4320 VTRACE(("glSecondaryColorPointer(4, GL_UNSIGNED_BYTE, %d, %p)\n", e->stride, e->data)); 4299 4321 4322 e = &si->elements[WINED3D_FFP_SPECULAR]; 4300 4323 if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { 4301 4324 GLenum type = e->format_desc->gl_vtx_type; … … 4358 4381 4359 4382 /* Texture coords -------------------------------------------*/ 4360 loadTexCoords( stateblock, si, &curVBO);4383 loadTexCoords(context, stateblock, si, &curVBO); 4361 4384 } 4362 4385 … … 4424 4447 } 4425 4448 } 4426 else if (fixup || (!dataLocations->elements[WINED3D_FFP_PSIZE].data 4427 && !dataLocations->position_transformed 4428 && (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) 4429 || (!dataLocations->elements[WINED3D_FFP_DIFFUSE].data 4430 && !dataLocations->elements[WINED3D_FFP_SPECULAR].data)))) 4449 else 4431 4450 { 4432 /* Load the vertex data using named arrays */ 4433 load_named = TRUE; 4434 device->useDrawStridedSlow = FALSE; 4435 } else { 4436 TRACE("Not loading vertex data\n"); 4437 device->useDrawStridedSlow = TRUE; 4451 WORD slow_mask = (1 << WINED3D_FFP_PSIZE); 4452 slow_mask |= -!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) & ((1 << WINED3D_FFP_DIFFUSE) | (1 << WINED3D_FFP_SPECULAR)); 4453 4454 if (fixup || (!dataLocations->position_transformed 4455 && !(dataLocations->use_map & slow_mask))) 4456 { 4457 /* Load the vertex data using named arrays */ 4458 load_named = TRUE; 4459 device->useDrawStridedSlow = FALSE; 4460 } 4461 else 4462 { 4463 TRACE("Not loading vertex data\n"); 4464 device->useDrawStridedSlow = TRUE; 4465 } 4438 4466 } 4439 4467 … … 4446 4474 else if (context->namedArraysLoaded) 4447 4475 { 4448 unloadVertexData( stateblock);4476 unloadVertexData(context); 4449 4477 context->namedArraysLoaded = FALSE; 4450 4478 } … … 4459 4487 { 4460 4488 TRACE("Loading vertex data\n"); 4461 loadVertexData( stateblock, dataLocations);4489 loadVertexData(context, stateblock, dataLocations); 4462 4490 context->namedArraysLoaded = TRUE; 4463 4491 } … … 4501 4529 * TODO: Move to the viewport state 4502 4530 */ 4503 if (useVertexShaderFunction) { 4531 if (useVertexShaderFunction) 4532 { 4533 GLfloat yoffset = -(63.0f / 64.0f) / stateblock->viewport.Height; 4504 4534 device->posFixup[1] = context->render_offscreen ? -1.0f : 1.0f; 4505 device->posFixup[3] = -device->posFixup[1] / stateblock->viewport.Height;4535 device->posFixup[3] = device->posFixup[1] * yoffset; 4506 4536 } 4507 4537 } … … 4648 4678 static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) 4649 4679 { 4650 stateblock->wineD3DDevice->posFixup[2] = 1.0f / stateblock->viewport.Width; 4651 stateblock->wineD3DDevice->posFixup[3] = -stateblock->wineD3DDevice->posFixup[1] / stateblock->viewport.Height; 4680 GLfloat yoffset = -(63.0f / 64.0f) / stateblock->viewport.Height; 4681 4682 stateblock->wineD3DDevice->posFixup[2] = (63.0f / 64.0f) / stateblock->viewport.Width; 4683 stateblock->wineD3DDevice->posFixup[3] = stateblock->wineD3DDevice->posFixup[1] * yoffset; 4684 4652 4685 if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) { 4653 4686 transform_projection(STATE_TRANSFORM(WINED3DTS_PROJECTION), stateblock, context); … … 4951 4984 { STATE_RENDER(WINED3DRS_EXTENTS), { STATE_RENDER(WINED3DRS_EXTENTS), state_extents }, WINED3D_GL_EXT_NONE }, 4952 4985 { STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), { STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_ckeyblend }, WINED3D_GL_EXT_NONE }, 4986 { STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), { STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), state_swvp }, WINED3D_GL_EXT_NONE }, 4953 4987 { STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), { STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), state_patchedgestyle}, WINED3D_GL_EXT_NONE }, 4954 4988 { STATE_RENDER(WINED3DRS_PATCHSEGMENTS), { STATE_RENDER(WINED3DRS_PATCHSEGMENTS), state_patchsegments }, WINED3D_GL_EXT_NONE }, … … 4965 4999 { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, 4966 5000 { STATE_RENDER(WINED3DRS_MULTISAMPLEMASK), { STATE_RENDER(WINED3DRS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE }, 5001 { STATE_RENDER(WINED3DRS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3DRS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, 4967 5002 { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE }, 4968 5003 { STATE_RENDER(WINED3DRS_BLENDOP), { STATE_RENDER(WINED3DRS_BLENDOP), state_blendop }, EXT_BLEND_MINMAX }, -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/stateblock.c
r22496 r23571 41 41 **************************************/ 42 42 43 /* * Allocates the correct amount of space for pixel and vertex shader constants,43 /* Allocates the correct amount of space for pixel and vertex shader constants, 44 44 * along with their set/changed flags on the given stateblock object 45 45 */ 46 HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) {47 46 HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) 47 { 48 48 IWineD3DStateBlockImpl *This = object; 49 49 … … 123 123 124 124 /** Set all members of a stateblock savedstate to the given value */ 125 void stateblock_savedstates_set( 126 IWineD3DStateBlock* iface, 127 SAVEDSTATES* states, 128 BOOL value) { 129 125 void stateblock_savedstates_set(IWineD3DStateBlock *iface, SAVEDSTATES *states, BOOL value) 126 { 130 127 IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; 131 128 unsigned bsize = sizeof(BOOL); … … 238 235 memcpy(Dest->pixelShaderConstantB, This->pixelShaderConstantB, sizeof(BOOL) * MAX_CONST_B); 239 236 memcpy(Dest->pixelShaderConstantI, This->pixelShaderConstantI, sizeof(INT) * MAX_CONST_I * 4); 240 237 241 238 memcpy(Dest->streamStride, This->streamStride, sizeof(UINT) * MAX_STREAMS); 242 239 memcpy(Dest->streamOffset, This->streamOffset, sizeof(UINT) * MAX_STREAMS); … … 855 852 } 856 853 857 if (This->changed.indices) { 858 IWineD3DDevice_SetIndices(pDevice, This->pIndexData, This->IndexFmt); 854 if (This->changed.indices) 855 { 856 IWineD3DDevice_SetIndexBuffer(pDevice, This->pIndexData, This->IndexFmt); 859 857 IWineD3DDevice_SetBaseVertexIndex(pDevice, This->baseVertexIndex); 860 858 } … … 1038 1036 } 1039 1037 This->wineD3DDevice->updateStateBlock->gl_primitive_type = This->gl_primitive_type; 1040 IWineD3DDevice_SetInd ices(pDevice, This->pIndexData, This->IndexFmt);1038 IWineD3DDevice_SetIndexBuffer(pDevice, This->pIndexData, This->IndexFmt); 1041 1039 IWineD3DDevice_SetBaseVertexIndex(pDevice, This->baseVertexIndex); 1042 1040 IWineD3DDevice_SetVertexDeclaration(pDevice, This->vertexDecl); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r22496 r23571 11 11 * Copyright 2007-2008 Henri Verbeet 12 12 * Copyright 2006-2008 Roderick Colenbrander 13 * Copyright 2009 Henri Verbeet for CodeWeavers 13 14 * 14 15 * This library is free software; you can redistribute it and/or … … 79 80 LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry) 80 81 { 81 GL_EXTCALL(glDeleteRenderbuffersEXT(1, &entry->id));82 gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id); 82 83 HeapFree(GetProcessHeap(), 0, entry); 83 84 } … … 132 133 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 133 134 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 134 WINED3DPOOL pool, IUnknown *parent )135 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 135 136 { 136 137 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; … … 169 170 170 171 hr = resource_init((IWineD3DResource *)surface, WINED3DRTYPE_SURFACE, 171 device, resource_size, usage, format_desc, pool, parent );172 device, resource_size, usage, format_desc, pool, parent, parent_ops); 172 173 if (FAILED(hr)) 173 174 { … … 311 312 /* Context activation is done by the caller. */ 312 313 static void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This, BOOL srgb) { 313 intactive_sampler;314 DWORD active_sampler; 314 315 315 316 /* We don't need a specific texture unit, but after binding the texture the current unit is dirty. … … 330 331 active_sampler = This->resource.wineD3DDevice->rev_tex_unit_map[active_texture - GL_TEXTURE0_ARB]; 331 332 332 if (active_sampler != -1) { 333 if (active_sampler != WINED3D_UNMAPPED_STAGE) 334 { 333 335 IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(active_sampler)); 334 336 } … … 342 344 IWineD3DSurfaceImpl* render_target = (IWineD3DSurfaceImpl*)device->render_targets[0]; 343 345 if ((render_target->resource.usage & WINED3DUSAGE_RENDERTARGET) 344 && (render_target->resource.format_desc->format == WINED3DFMT_P8 ))346 && (render_target->resource.format_desc->format == WINED3DFMT_P8_UINT)) 345 347 return TRUE; 346 348 } … … 359 361 360 362 /* Only support read back of converted P8 surfaces */ 361 if (This->Flags & SFLAG_CONVERTED && format_desc->format != WINED3DFMT_P8 )363 if (This->Flags & SFLAG_CONVERTED && format_desc->format != WINED3DFMT_P8_UINT) 362 364 { 363 365 FIXME("Read back converted textures unsupported, format=%s\n", debug_d3dformat(format_desc->format)); … … 378 380 checkGLcall("glBindBufferARB"); 379 381 GL_EXTCALL(glGetCompressedTexImageARB(This->texture_target, This->texture_level, NULL)); 380 checkGLcall("glGetCompressedTexImageARB ()");382 checkGLcall("glGetCompressedTexImageARB"); 381 383 GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); 382 384 checkGLcall("glBindBufferARB"); … … 386 388 GL_EXTCALL(glGetCompressedTexImageARB(This->texture_target, 387 389 This->texture_level, This->resource.allocatedMemory)); 388 checkGLcall("glGetCompressedTexImageARB ()");390 checkGLcall("glGetCompressedTexImageARB"); 389 391 } 390 392 … … 398 400 399 401 /* In case of P8 the index is stored in the alpha component if the primary render target uses P8 */ 400 if (format_desc->format == WINED3DFMT_P8 && primary_render_target_is_p8(This->resource.wineD3DDevice))402 if (format_desc->format == WINED3DFMT_P8_UINT && primary_render_target_is_p8(This->resource.wineD3DDevice)) 401 403 { 402 404 format = GL_ALPHA; … … 422 424 423 425 glGetTexImage(This->texture_target, This->texture_level, format, type, NULL); 424 checkGLcall("glGetTexImage ()");426 checkGLcall("glGetTexImage"); 425 427 426 428 GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); … … 428 430 } else { 429 431 glGetTexImage(This->texture_target, This->texture_level, format, type, mem); 430 checkGLcall("glGetTexImage ()");432 checkGLcall("glGetTexImage"); 431 433 } 432 434 LEAVE_GL(); … … 618 620 void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height) { 619 621 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; 622 const struct wined3d_gl_info *gl_info = &This->resource.wineD3DDevice->adapter->gl_info; 620 623 renderbuffer_entry_t *entry; 621 624 GLuint renderbuffer = 0; … … 629 632 630 633 /* Remove any renderbuffer set if the sizes match */ 631 if (width == src_width && height == src_height) { 634 if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] 635 || (width == src_width && height == src_height)) 636 { 632 637 This->current_renderbuffer = NULL; 633 638 return; … … 644 649 645 650 if (!renderbuffer) { 646 GL_EXTCALL(glGenRenderbuffersEXT(1, &renderbuffer));647 GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffer));648 GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,649 This->resource.format_desc->glInternal, width, height) );651 gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer); 652 gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer); 653 gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, 654 This->resource.format_desc->glInternal, width, height); 650 655 651 656 entry = HeapAlloc(GetProcessHeap(), 0, sizeof(renderbuffer_entry_t)); … … 736 741 { 737 742 surface_cleanup(This); 743 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 738 744 739 745 TRACE("(%p) Released.\n", This); … … 768 774 } 769 775 770 if (This->resource.format_desc->format == WINED3DFMT_P8 771 || This->resource.format_desc->format == WINED3DFMT_ A8P8)776 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 777 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 772 778 { 773 779 if(palette9_changed(This)) { … … 806 812 ENTER_GL(); 807 813 GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, This->pbo)); 808 checkGLcall("glBindBuffer (GL_PIXEL_UNPACK_BUFFER, This->pbo)");814 checkGLcall("glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, This->pbo)"); 809 815 GL_EXTCALL(glGetBufferSubDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0, This->resource.size, This->resource.allocatedMemory)); 810 checkGLcall("glGetBufferSubData ");816 checkGLcall("glGetBufferSubDataARB"); 811 817 GL_EXTCALL(glDeleteBuffersARB(1, &This->pbo)); 812 checkGLcall("glDeleteBuffers ");818 checkGLcall("glDeleteBuffersARB"); 813 819 LEAVE_GL(); 814 820 … … 821 827 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; 822 828 IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; 829 const struct wined3d_context *context; 830 const struct wined3d_gl_info *gl_info; 823 831 renderbuffer_entry_t *entry, *entry2; 824 832 TRACE("(%p)\n", iface); … … 851 859 This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED); 852 860 853 ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD); 861 context = ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD); 862 gl_info = context->gl_info; 854 863 855 864 /* Destroy PBOs, but load them into real sysmem before */ … … 864 873 LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry) { 865 874 ENTER_GL(); 866 GL_EXTCALL(glDeleteRenderbuffersEXT(1, &entry->id));875 gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id); 867 876 LEAVE_GL(); 868 877 list_remove(&entry->entry); … … 961 970 switch(This->resource.format_desc->format) 962 971 { 963 case WINED3DFMT_P8 :972 case WINED3DFMT_P8_UINT: 964 973 { 965 974 if(primary_render_target_is_p8(myDevice)) { … … 1011 1020 /* Save old pixel store pack state */ 1012 1021 glGetIntegerv(GL_PACK_ROW_LENGTH, &rowLen); 1013 checkGLcall("gl Integerv");1022 checkGLcall("glGetIntegerv"); 1014 1023 glGetIntegerv(GL_PACK_SKIP_PIXELS, &skipPix); 1015 checkGLcall("gl Integerv");1024 checkGLcall("glGetIntegerv"); 1016 1025 glGetIntegerv(GL_PACK_SKIP_ROWS, &skipRow); 1017 checkGLcall("gl Integerv");1026 checkGLcall("glGetIntegerv"); 1018 1027 1019 1028 /* Setup pixel store pack state -- to glReadPixels into the correct place */ … … 1067 1076 if(!row) { 1068 1077 ERR("Out of memory\n"); 1069 if (This->resource.format_desc->format == WINED3DFMT_P8 ) HeapFree(GetProcessHeap(), 0, mem);1078 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT) HeapFree(GetProcessHeap(), 0, mem); 1070 1079 LEAVE_GL(); 1071 1080 return; … … 1097 1106 * In case of P8 render targets, the index is stored in the alpha component so no conversion is needed. 1098 1107 */ 1099 if ( (This->resource.format_desc->format == WINED3DFMT_P8)&& !primary_render_target_is_p8(myDevice))1108 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && !primary_render_target_is_p8(myDevice)) 1100 1109 { 1101 1110 const PALETTEENTRY *pal = NULL; … … 1394 1403 1395 1404 glGetIntegerv(GL_PACK_SWAP_BYTES, &prev_store); 1396 checkGLcall("gl Integerv");1405 checkGLcall("glGetIntegerv"); 1397 1406 glGetIntegerv(GL_CURRENT_RASTER_POSITION, &prev_rasterpos[0]); 1398 checkGLcall("gl Integerv");1407 checkGLcall("glGetIntegerv"); 1399 1408 glPixelZoom(1.0f, -1.0f); 1400 1409 checkGLcall("glPixelZoom"); … … 1405 1414 1406 1415 glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1); 1407 checkGLcall("glRasterPos 2f");1416 checkGLcall("glRasterPos3i"); 1408 1417 1409 1418 /* Some drivers(radeon dri, others?) don't like exceptions during … … 1455 1464 /* Reset to previous pack row length */ 1456 1465 glPixelStorei(GL_UNPACK_ROW_LENGTH, skipBytes); 1457 checkGLcall("glPixelStorei GL_UNPACK_ROW_LENGTH");1466 checkGLcall("glPixelStorei(GL_UNPACK_ROW_LENGTH)"); 1458 1467 1459 1468 if(!swapchain) { … … 1525 1534 switch(wined3d_settings.rendertargetlock_mode) { 1526 1535 case RTL_READTEX: 1527 case RTL_TEXTEX:1528 1536 IWineD3DSurface_LoadLocation(iface, SFLAG_INTEXTURE, NULL /* partial texture loading not supported yet */); 1529 1537 /* drop through */ 1530 1538 1531 case RTL_AUTO:1532 1539 case RTL_READDRAW: 1533 case RTL_TEXDRAW:1534 1540 IWineD3DSurface_LoadLocation(iface, SFLAG_INDRAWABLE, fullsurface ? NULL : &This->dirtyRect); 1535 1541 break; … … 1601 1607 return WINED3DERR_INVALIDCALL; 1602 1608 1603 /* According to Direct3D9 docs, only these formats are supported */1604 if (((IWineD3DImpl *)This->resource.wineD3DDevice->wineD3D)->dxVersion > 7) {1605 if (This->resource.format_desc->format != WINED3DFMT_R5G6B51606 && This->resource.format_desc->format != WINED3DFMT_X1R5G5B51607 && This->resource.format_desc->format != WINED3DFMT_R8G8B81608 && This->resource.format_desc->format != WINED3DFMT_X8R8G8B8)1609 return WINED3DERR_INVALIDCALL;1610 }1611 1612 1609 memset(&lock, 0, sizeof(lock)); /* To be sure */ 1613 1610 1614 1611 /* Create a DIB section if there isn't a hdc yet */ 1615 1612 if(!This->hDC) { 1616 IWineD3DBaseSurfaceImpl_CreateDIBSection(iface); 1613 hr = IWineD3DBaseSurfaceImpl_CreateDIBSection(iface); 1614 if(FAILED(hr)) return WINED3DERR_INVALIDCALL; 1617 1615 if(This->Flags & SFLAG_CLIENT) { 1618 1616 surface_internal_preload(iface, SRGB_RGB); … … 1641 1639 } 1642 1640 1643 if (This->resource.format_desc->format == WINED3DFMT_P8 1644 || This->resource.format_desc->format == WINED3DFMT_ A8P8)1641 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 1642 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 1645 1643 { 1646 1644 /* GetDC on palettized formats is unsupported in D3D9, and the method is missing in … … 1734 1732 switch(This->resource.format_desc->format) 1735 1733 { 1736 case WINED3DFMT_P8 :1734 case WINED3DFMT_P8_UINT: 1737 1735 /* **************** 1738 1736 Paletted Texture … … 1769 1767 break; 1770 1768 1771 case WINED3DFMT_ R3G3B2:1769 case WINED3DFMT_B2G3R3_UNORM: 1772 1770 /* ********************** 1773 1771 GL_UNSIGNED_BYTE_3_3_2 … … 1780 1778 break; 1781 1779 1782 case WINED3DFMT_ R5G6B5:1780 case WINED3DFMT_B5G6R5_UNORM: 1783 1781 if (colorkey_active) { 1784 1782 *convert = CONVERT_CK_565; … … 1789 1787 break; 1790 1788 1791 case WINED3DFMT_ X1R5G5B5:1789 case WINED3DFMT_B5G5R5X1_UNORM: 1792 1790 if (colorkey_active) { 1793 1791 *convert = CONVERT_CK_5551; … … 1798 1796 break; 1799 1797 1800 case WINED3DFMT_ R8G8B8:1798 case WINED3DFMT_B8G8R8_UNORM: 1801 1799 if (colorkey_active) { 1802 1800 *convert = CONVERT_CK_RGB24; … … 1808 1806 break; 1809 1807 1810 case WINED3DFMT_ X8R8G8B8:1808 case WINED3DFMT_B8G8R8X8_UNORM: 1811 1809 if (colorkey_active) { 1812 1810 *convert = CONVERT_RGB32_888; … … 1825 1823 break; 1826 1824 1827 case WINED3DFMT_ L6V5U5:1825 case WINED3DFMT_R5G5_SNORM_L6_UNORM: 1828 1826 *convert = CONVERT_L6V5U5; 1829 1827 if(GL_SUPPORT(NV_TEXTURE_SHADER)) { … … 1838 1836 break; 1839 1837 1840 case WINED3DFMT_ X8L8V8U8:1838 case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: 1841 1839 *convert = CONVERT_X8L8V8U8; 1842 1840 *target_bpp = 4; … … 1870 1868 break; 1871 1869 1872 case WINED3DFMT_ A4L4:1873 /* A4L4exists as an internal gl format, but for some reason there is not1870 case WINED3DFMT_L4A4_UNORM: 1871 /* WINED3DFMT_L4A4_UNORM exists as an internal gl format, but for some reason there is not 1874 1872 * format+type combination to load it. Thus convert it to A8L8, then load it 1875 1873 * with A4L4 internal, but A8L8 format+type … … 1902 1900 break; 1903 1901 1904 case WINED3DFMT_D15S1: 1905 if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 1902 case WINED3DFMT_S1_UINT_D15_UNORM: 1903 if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT) 1904 || GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 1906 1905 { 1907 1906 *convert = CONVERT_D15S1; … … 1910 1909 break; 1911 1910 1912 case WINED3DFMT_D24X4S4: 1913 if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 1911 case WINED3DFMT_S4X4_UINT_D24_UNORM: 1912 if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT) 1913 || GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 1914 1914 { 1915 1915 *convert = CONVERT_D24X4S4; … … 1917 1917 break; 1918 1918 1919 case WINED3DFMT_ D24FS8:1919 case WINED3DFMT_S8_UINT_D24_FLOAT: 1920 1920 if (GL_SUPPORT(ARB_DEPTH_BUFFER_FLOAT)) 1921 1921 { … … 2517 2517 IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; 2518 2518 2519 if (This->palette || (This->resource.format_desc->format != WINED3DFMT_P8 2520 && This->resource.format_desc->format != WINED3DFMT_ A8P8))2519 if (This->palette || (This->resource.format_desc->format != WINED3DFMT_P8_UINT 2520 && This->resource.format_desc->format != WINED3DFMT_P8_UINT_A8_UNORM)) 2521 2521 { 2522 2522 /* If a ddraw-style palette is attached assume no d3d9 palette change. … … 2742 2742 FIXME("Saving texture level %d width %d height %d\n", This->texture_level, width, height); 2743 2743 glGetTexImage(GL_TEXTURE_2D, This->texture_level, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, allocatedMemory); 2744 checkGLcall("gl TexImage2D");2744 checkGLcall("glGetTexImage"); 2745 2745 if (tmpTexture) { 2746 2746 glBindTexture(GL_TEXTURE_2D, 0); … … 2985 2985 2986 2986 if(override) { 2987 /* DDraw sets this for the X11 surfaces, so don't confuse the user 2987 /* DDraw sets this for the X11 surfaces, so don't confuse the user 2988 2988 * FIXME("(%p) Target override is not supported by now\n", This); 2989 2989 * Additionally, it isn't really possible to support triple-buffering … … 3108 3108 3109 3109 LEAVE_GL(); 3110 3111 /* The texture is now most up to date - If the surface is a render target and has a drawable, this 3112 * path is never entered 3113 */ 3114 IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE); 3110 3115 } 3111 3116 … … 3355 3360 3356 3361 LEAVE_GL(); 3362 3363 /* The texture is now most up to date - If the surface is a render target and has a drawable, this 3364 * path is never entered 3365 */ 3366 IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE); 3357 3367 } 3358 3368 … … 3577 3587 /* When blitting from a render target a texture, the texture isn't required to have a palette. 3578 3588 * In this case grab the palette from the render target. */ 3579 if ( (This->resource.format_desc->format == WINED3DFMT_P8) && (This->palette == NULL))3589 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && !This->palette) 3580 3590 { 3581 3591 paletteOverride = TRUE; … … 3599 3609 * backends. 3600 3610 */ 3601 if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT) 3611 if (wined3d_settings.offscreen_rendering_mode == ORM_FBO 3612 && myDevice->adapter->gl_info.fbo_ops.glBlitFramebuffer 3602 3613 && surface_can_stretch_rect(Src, This)) 3603 3614 { … … 3624 3635 This->Flags &= ~SFLAG_INSYSMEM; 3625 3636 } 3626 /* The texture is now most up to date - If the surface is a render target and has a drawable, this3627 * path is never entered3628 */3629 IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);3630 3637 3631 3638 return WINED3D_OK; … … 3656 3663 * code further down the road retrieves the palette from the surface, so 3657 3664 * it must have a palette set. */ 3658 if ( (Src->resource.format_desc->format == WINED3DFMT_P8) && (Src->palette == NULL))3665 if (Src->resource.format_desc->format == WINED3DFMT_P8_UINT && !Src->palette) 3659 3666 { 3660 3667 paletteOverride = TRUE; … … 3663 3670 } 3664 3671 3665 if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT) 3672 if (wined3d_settings.offscreen_rendering_mode == ORM_FBO 3673 && myDevice->adapter->gl_info.fbo_ops.glBlitFramebuffer 3666 3674 && !(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) 3667 3675 && surface_can_stretch_rect(Src, This)) … … 3768 3776 if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) { 3769 3777 glEnable(GL_ALPHA_TEST); 3770 checkGLcall("glEnable GL_ALPHA_TEST");3778 checkGLcall("glEnable(GL_ALPHA_TEST)"); 3771 3779 3772 3780 /* When the primary render target uses P8, the alpha component contains the palette index. … … 3780 3788 } else { 3781 3789 glDisable(GL_ALPHA_TEST); 3782 checkGLcall("glDisable GL_ALPHA_TEST");3790 checkGLcall("glDisable(GL_ALPHA_TEST)"); 3783 3791 } 3784 3792 … … 3826 3834 /* Flush in case the drawable is used by multiple GL contexts */ 3827 3835 if(dstSwapchain && (This == (IWineD3DSurfaceImpl *) dstSwapchain->frontBuffer || dstSwapchain->num_contexts >= 2)) 3828 glFlush();3836 wglFlush(); 3829 3837 3830 3838 /* TODO: If the surface is locked often, perform the Blt in software on the memory instead */ … … 3855 3863 * 'clear' expect it in ARGB format => we need to do some conversion :-) 3856 3864 */ 3857 if (This->resource.format_desc->format == WINED3DFMT_P8 )3865 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT) 3858 3866 { 3859 3867 DWORD alpha; … … 3871 3879 } 3872 3880 } 3873 else if (This->resource.format_desc->format == WINED3DFMT_ R5G6B5)3881 else if (This->resource.format_desc->format == WINED3DFMT_B5G6R5_UNORM) 3874 3882 { 3875 3883 if (DDBltFx->u5.dwFillColor == 0xFFFF) { … … 3882 3890 } 3883 3891 } 3884 else if ( (This->resource.format_desc->format == WINED3DFMT_R8G8B8)3885 || (This->resource.format_desc->format == WINED3DFMT_X8R8G8B8))3892 else if (This->resource.format_desc->format == WINED3DFMT_B8G8R8_UNORM 3893 || This->resource.format_desc->format == WINED3DFMT_B8G8R8X8_UNORM) 3886 3894 { 3887 3895 color = 0xFF000000 | DDBltFx->u5.dwFillColor; 3888 3896 } 3889 else if (This->resource.format_desc->format == WINED3DFMT_ A8R8G8B8)3897 else if (This->resource.format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) 3890 3898 { 3891 3899 color = DDBltFx->u5.dwFillColor; … … 3920 3928 depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000ffff; 3921 3929 break; 3922 case WINED3DFMT_ D15S1:3930 case WINED3DFMT_S1_UINT_D15_UNORM: 3923 3931 depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000fffe; 3924 3932 break; 3925 case WINED3DFMT_ D24S8:3926 case WINED3DFMT_ D24X8:3933 case WINED3DFMT_S8_UINT_D24_UNORM: 3934 case WINED3DFMT_X8D24_UNORM: 3927 3935 depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x00ffffff; 3928 3936 break; 3929 case WINED3DFMT_D32 :3937 case WINED3DFMT_D32_UNORM: 3930 3938 depth = (float) DDBltFx->u5.dwFillDepth / (float) 0xffffffff; 3931 3939 break; … … 4060 4068 if (!pal) return WINED3D_OK; 4061 4069 4062 if (This->resource.format_desc->format == WINED3DFMT_P8 4063 || This->resource.format_desc->format == WINED3DFMT_ A8P8)4070 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 4071 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 4064 4072 { 4065 4073 int bpp; … … 4068 4076 4069 4077 /* Check if we are using a RTL mode which uses texturing for uploads */ 4070 BOOL use_texture = (wined3d_settings.rendertargetlock_mode == RTL_READTEX || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX);4078 BOOL use_texture = (wined3d_settings.rendertargetlock_mode == RTL_READTEX); 4071 4079 4072 4080 /* Check if we have hardware palette conversion if we have convert is set to NO_CONVERSION */ … … 4173 4181 doesn't work in combination with ARB_TEXTURE_RECTANGLE. 4174 4182 */ 4175 if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE) 4176 && !((This->resource.format_desc->format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE) 4177 && (wined3d_settings.rendertargetlock_mode == RTL_READTEX 4178 || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX))) 4183 if (This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE) 4184 && !(This->resource.format_desc->format == WINED3DFMT_P8_UINT && GL_SUPPORT(EXT_PALETTED_TEXTURE) 4185 && wined3d_settings.rendertargetlock_mode == RTL_READTEX)) 4179 4186 { 4180 4187 This->texture_target = GL_TEXTURE_RECTANGLE_ARB; … … 4361 4368 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; 4362 4369 IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; 4370 const struct wined3d_gl_info *gl_info = context->gl_info; 4363 4371 4364 4372 TRACE("(%p) New location %#x\n", This, location); … … 4392 4400 /* Note that we use depth_blt here as well, rather than glCopyTexImage2D 4393 4401 * directly on the FBO texture. That's because we need to flip. */ 4394 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);4402 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 4395 4403 if (This->texture_target == GL_TEXTURE_RECTANGLE_ARB) 4396 4404 { … … 4414 4422 /* Setup the destination */ 4415 4423 if (!device->depth_blt_rb) { 4416 GL_EXTCALL(glGenRenderbuffersEXT(1, &device->depth_blt_rb));4424 gl_info->fbo_ops.glGenRenderbuffers(1, &device->depth_blt_rb); 4417 4425 checkGLcall("glGenRenderbuffersEXT"); 4418 4426 } 4419 4427 if (device->depth_blt_rb_w != This->currentDesc.Width 4420 4428 || device->depth_blt_rb_h != This->currentDesc.Height) { 4421 GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, device->depth_blt_rb));4429 gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, device->depth_blt_rb); 4422 4430 checkGLcall("glBindRenderbufferEXT"); 4423 GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA8, This->currentDesc.Width, This->currentDesc.Height)); 4431 gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, 4432 This->currentDesc.Width, This->currentDesc.Height); 4424 4433 checkGLcall("glRenderbufferStorageEXT"); 4425 4434 device->depth_blt_rb_w = This->currentDesc.Width; … … 4427 4436 } 4428 4437 4429 context_bind_fbo(context, GL_FRAMEBUFFER_EXT, &context->dst_fbo); 4430 GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, device->depth_blt_rb)); 4438 context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo); 4439 gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, 4440 GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, device->depth_blt_rb); 4431 4441 checkGLcall("glFramebufferRenderbufferEXT"); 4432 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER _EXT, iface, FALSE);4442 context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, iface, FALSE); 4433 4443 4434 4444 /* Do the actual blit */ … … 4436 4446 checkGLcall("depth_blt"); 4437 4447 4438 if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &context->current_fbo->id);4439 else context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);4448 if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER, &context->current_fbo->id); 4449 else context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 4440 4450 4441 4451 LEAVE_GL(); … … 4449 4459 ENTER_GL(); 4450 4460 4451 context_bind_fbo(context, GL_FRAMEBUFFER _EXT, NULL);4461 context_bind_fbo(context, GL_FRAMEBUFFER, NULL); 4452 4462 surface_depth_blt(This, This->texture_name, This->currentDesc.Width, 4453 4463 This->currentDesc.Height, This->texture_target); 4454 4464 checkGLcall("depth_blt"); 4455 4465 4456 if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER _EXT, &context->current_fbo->id);4466 if (context->current_fbo) context_bind_fbo(context, GL_FRAMEBUFFER, &context->current_fbo->id); 4457 4467 4458 4468 LEAVE_GL(); … … 4655 4665 checkGLcall("glEnable(bind_target)"); 4656 4666 glBindTexture(bind_target, This->texture_name); 4657 checkGLcall(" bind_target, This->texture_name)");4667 checkGLcall("glBindTexture(bind_target, This->texture_name)"); 4658 4668 glTexParameteri(bind_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 4659 4669 checkGLcall("glTexParameteri"); … … 4693 4703 if(((IWineD3DSwapChainImpl*)swapchain)->frontBuffer == (IWineD3DSurface*)This || 4694 4704 ((IWineD3DSwapChainImpl*)swapchain)->num_contexts >= 2) 4695 glFlush();4705 wglFlush(); 4696 4706 4697 4707 IWineD3DSwapChain_Release(swapchain); … … 4702 4712 if(SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface*)This, &IID_IWineD3DBaseTexture, (void **) &texture))) 4703 4713 { 4704 ((IWineD3DBaseTextureImpl *) texture)->baseTexture. states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;4705 ((IWineD3DBaseTextureImpl *) texture)->baseTexture. states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;4706 ((IWineD3DBaseTextureImpl *) texture)->baseTexture. states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;4714 ((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; 4715 ((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; 4716 ((IWineD3DBaseTextureImpl *) texture)->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE; 4707 4717 IWineD3DBaseTexture_Release(texture); 4708 4718 } … … 4851 4861 } 4852 4862 } else { 4853 if((This->Flags & SFLAG_LOCATIONS) == SFLAG_INSRGBTEX) {4863 if((This->Flags & (SFLAG_INSRGBTEX | SFLAG_INSYSMEM)) == SFLAG_INSRGBTEX) { 4854 4864 /* Performance warning ... */ 4855 4865 FIXME("%p: Downloading srgb texture to reload it as rgb\n", This); 4856 4866 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect); 4857 4867 } 4868 } 4869 if(!(This->Flags & SFLAG_INSYSMEM)) { 4870 /* Should not happen */ 4871 ERR("Trying to load a texture from sysmem, but SFLAG_INSYSMEM is not set\n"); 4872 /* Lets hope we get it from somewhere... */ 4873 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect); 4858 4874 } 4859 4875 … … 4894 4910 This->Flags |= SFLAG_CONVERTED; 4895 4911 } 4896 else if ( (This->resource.format_desc->format == WINED3DFMT_P8)4912 else if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 4897 4913 && (GL_SUPPORT(EXT_PALETTED_TEXTURE) || GL_SUPPORT(ARB_FRAGMENT_PROGRAM))) 4898 4914 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_base.c
r21731 r23571 11 11 * Copyright 2007 Henri Verbeet 12 12 * Copyright 2006-2007 Roderick Colenbrander 13 * Copyright 2009 Henri Verbeet for CodeWeavers 13 14 * 14 15 * This library is free software; you can redistribute it and/or … … 552 553 UINT usage; 553 554 555 if(!(format_desc->Flags & WINED3DFMT_FLAG_GETDC)) 556 { 557 WARN("Cannot use GetDC on a %s surface\n", debug_d3dformat(format_desc->format)); 558 return WINED3DERR_INVALIDCALL; 559 } 560 554 561 switch (format_desc->byte_count) 555 562 { … … 602 609 switch (This->resource.format_desc->format) 603 610 { 604 case WINED3DFMT_ R8G8B8:611 case WINED3DFMT_B8G8R8_UNORM: 605 612 usage = DIB_RGB_COLORS; 606 613 b_info->bmiHeader.biCompression = BI_RGB; 607 614 break; 608 615 609 case WINED3DFMT_ X1R5G5B5:610 case WINED3DFMT_ A1R5G5B5:611 case WINED3DFMT_ A4R4G4B4:612 case WINED3DFMT_ X4R4G4B4:613 case WINED3DFMT_ R3G3B2:614 case WINED3DFMT_ A8R3G3B2:616 case WINED3DFMT_B5G5R5X1_UNORM: 617 case WINED3DFMT_B5G5R5A1_UNORM: 618 case WINED3DFMT_B4G4R4A4_UNORM: 619 case WINED3DFMT_B4G4R4X4_UNORM: 620 case WINED3DFMT_B2G3R3_UNORM: 621 case WINED3DFMT_B2G3R3A8_UNORM: 615 622 case WINED3DFMT_R10G10B10A2_UNORM: 616 623 case WINED3DFMT_R8G8B8A8_UNORM: 617 case WINED3DFMT_ X8B8G8R8:618 case WINED3DFMT_ A2R10G10B10:619 case WINED3DFMT_ R5G6B5:624 case WINED3DFMT_R8G8B8X8_UNORM: 625 case WINED3DFMT_B10G10R10A2_UNORM: 626 case WINED3DFMT_B5G6R5_UNORM: 620 627 case WINED3DFMT_R16G16B16A16_UNORM: 621 628 usage = 0; … … 760 767 static const struct d3dfmt_convertor_desc convertors[] = 761 768 { 762 {WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT,convert_r32_float_r16_float},763 {WINED3DFMT_ R5G6B5, WINED3DFMT_X8R8G8B8,convert_r5g6b5_x8r8g8b8},764 {WINED3DFMT_ A8R8G8B8, WINED3DFMT_X8R8G8B8,convert_a8r8g8b8_x8r8g8b8},769 {WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT, convert_r32_float_r16_float}, 770 {WINED3DFMT_B5G6R5_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_r5g6b5_x8r8g8b8}, 771 {WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_a8r8g8b8_x8r8g8b8}, 765 772 }; 766 773 … … 803 810 source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, 804 811 0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */, 805 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), NULL /* parent */); 812 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 813 NULL /* parent */, &wined3d_null_parent_ops); 806 814 if(!ret) { 807 815 ERR("Failed to create a destination surface for conversion\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_gdi.c
r21731 r23571 323 323 fprintf(f, "P6\n%d %d\n255\n", This->pow2Width, This->pow2Height); 324 324 325 if (This->resource.format_desc->format == WINED3DFMT_P8 )325 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT) 326 326 { 327 327 unsigned char table[256][3]; … … 393 393 394 394 TRACE("(%p)->(%p)\n",This,pHDC); 395 396 if(!(This->Flags & SFLAG_DIBSECTION)) 397 { 398 WARN("DC not supported on this surface\n"); 399 return WINED3DERR_INVALIDCALL; 400 } 395 401 396 402 if(This->Flags & SFLAG_USERPTR) { … … 422 428 } 423 429 424 if (This->resource.format_desc->format == WINED3DFMT_P8 425 || This->resource.format_desc->format == WINED3DFMT_ A8P8)430 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 431 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 426 432 { 427 433 unsigned int n; … … 535 541 { 536 542 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; 543 HRESULT hr; 537 544 538 545 if(This->resource.usage & WINED3DUSAGE_OVERLAY) … … 541 548 return WINED3DERR_INVALIDCALL; 542 549 } 550 543 551 /* Sysmem textures have memory already allocated - 544 552 * release it, this avoids an unnecessary memcpy 545 553 */ 546 HeapFree(GetProcessHeap(), 0, This->resource.heapMemory); 547 This->resource.allocatedMemory = NULL; 548 This->resource.heapMemory = NULL; 554 hr = IWineD3DBaseSurfaceImpl_CreateDIBSection(iface); 555 if(SUCCEEDED(hr)) 556 { 557 HeapFree(GetProcessHeap(), 0, This->resource.heapMemory); 558 This->resource.heapMemory = NULL; 559 This->resource.allocatedMemory = This->dib.bitmap_data; 560 } 549 561 550 562 /* We don't mind the nonpow2 stuff in GDI */ 551 563 This->pow2Width = This->currentDesc.Width; 552 564 This->pow2Height = This->currentDesc.Height; 553 554 IWineD3DBaseSurfaceImpl_CreateDIBSection(iface);555 This->resource.allocatedMemory = This->dib.bitmap_data;556 565 557 566 return WINED3D_OK; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c
r22496 r23571 46 46 47 47 /*IWineD3DSwapChain parts follow: */ 48 static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderTarget) { 48 static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface) 49 { 49 50 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; 50 51 WINED3DDISPLAYMODE mode; … … 55 56 IWineD3DSwapChain_SetGammaRamp(iface, 0, &This->orig_gamma); 56 57 57 /* release the ref to the front and back buffer parents */ 58 if(This->frontBuffer) { 58 /* Release the swapchain's draw buffers. Make sure This->backBuffer[0] is 59 * the last buffer to be destroyed, FindContext() depends on that. */ 60 if (This->frontBuffer) 61 { 59 62 IWineD3DSurface_SetContainer(This->frontBuffer, 0); 60 if(D3DCB_DestroyRenderTarget(This->frontBuffer) > 0) { 61 FIXME("(%p) Something's still holding the front buffer\n",This); 62 } 63 } 64 65 if(This->backBuffer) { 66 UINT i; 67 for(i = 0; i < This->presentParms.BackBufferCount; i++) { 63 if (IWineD3DSurface_Release(This->frontBuffer)) 64 { 65 WARN("(%p) Something's still holding the front buffer (%p).\n", 66 This, This->frontBuffer); 67 } 68 This->frontBuffer = NULL; 69 } 70 71 if (This->backBuffer) 72 { 73 UINT i = This->presentParms.BackBufferCount; 74 75 while (i--) 76 { 68 77 IWineD3DSurface_SetContainer(This->backBuffer[i], 0); 69 if (D3DCB_DestroyRenderTarget(This->backBuffer[i]) > 0) {70 FIXME("(%p) Something's still holding the back buffer\n",This);71 }78 if (IWineD3DSurface_Release(This->backBuffer[i])) 79 WARN("(%p) Something's still holding back buffer %u (%p).\n", 80 This, i, This->backBuffer[i]); 72 81 } 73 82 HeapFree(GetProcessHeap(), 0, This->backBuffer); 83 This->backBuffer = NULL; 74 84 } 75 85 … … 120 130 cursor.resource.wineD3DDevice = This->wineD3DDevice; 121 131 cursor.resource.pool = WINED3DPOOL_SCRATCH; 122 cursor.resource.format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->wineD3DDevice->adapter->gl_info); 132 cursor.resource.format_desc = 133 getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->wineD3DDevice->adapter->gl_info); 123 134 cursor.resource.resourceType = WINED3DRTYPE_SURFACE; 124 135 cursor.texture_name = This->wineD3DDevice->cursorTexture; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain_base.c
r16477 r23571 69 69 TRACE("(%p) : ReleaseRef to %d\n", This, refCount); 70 70 if (refCount == 0) { 71 IWineD3DSwapChain_Destroy(iface , D3DCB_DefaultDestroySurface);71 IWineD3DSwapChain_Destroy(iface); 72 72 } 73 73 return refCount; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain_gdi.c
r16477 r23571 37 37 WINE_DECLARE_DEBUG_CHANNEL(fps); 38 38 39 static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderback) { 39 static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface) 40 { 40 41 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; 41 42 WINED3DDISPLAYMODE mode; … … 48 49 if(This->frontBuffer) { 49 50 IWineD3DSurface_SetContainer(This->frontBuffer, 0); 50 if(D3DCB_DestroyRenderback(This->frontBuffer) > 0) { 51 FIXME("(%p) Something's still holding the front buffer\n",This); 51 if (IWineD3DSurface_Release(This->frontBuffer) > 0) 52 { 53 WARN("(%p) Something's still holding the front buffer\n",This); 52 54 } 53 55 } … … 57 59 for(i = 0; i < This->presentParms.BackBufferCount; i++) { 58 60 IWineD3DSurface_SetContainer(This->backBuffer[i], 0); 59 if(D3DCB_DestroyRenderback(This->backBuffer[i]) > 0) { 60 FIXME("(%p) Something's still holding the back buffer\n",This); 61 if (IWineD3DSurface_Release(This->backBuffer[i]) > 0) 62 { 63 WARN("(%p) Something's still holding the back buffer\n",This); 61 64 } 62 65 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r22496 r23571 6 6 * Copyright 2005 Oliver Stieber 7 7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 67 68 break; 68 69 } 69 dirty = srgb_mode ? &This->baseTexture. srgbDirty : &This->baseTexture.dirty;70 dirty = srgb_mode ? &This->baseTexture.texture_srgb.dirty : &This->baseTexture.texture_rgb.dirty; 70 71 71 72 if (!device->isInDraw) … … 76 77 } 77 78 78 if (This->resource.format_desc->format == WINED3DFMT_P8 79 || This->resource.format_desc->format == WINED3DFMT_ A8P8)79 if (This->resource.format_desc->format == WINED3DFMT_P8_UINT 80 || This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM) 80 81 { 81 82 for (i = 0; i < This->baseTexture.levels; ++i) … … 110 111 } 111 112 112 static void texture_cleanup(IWineD3DTextureImpl *This , D3DCB_DESTROYSURFACEFN surface_destroy_cb)113 static void texture_cleanup(IWineD3DTextureImpl *This) 113 114 { 114 115 unsigned int i; … … 126 127 surface_set_texture_target(This->surfaces[i], 0); 127 128 IWineD3DSurface_SetContainer(This->surfaces[i], 0); 128 surface_destroy_cb(This->surfaces[i]);129 IWineD3DSurface_Release(This->surfaces[i]); 129 130 } 130 131 } … … 132 133 TRACE("(%p) : Cleaning up base texture\n", This); 133 134 basetexture_cleanup((IWineD3DBaseTexture *)This); 134 }135 136 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels,137 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)138 {139 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;140 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);141 UINT pow2_width, pow2_height;142 UINT tmp_w, tmp_h;143 unsigned int i;144 HRESULT hr;145 146 /* TODO: It should only be possible to create textures for formats147 * that are reported as supported. */148 if (WINED3DFMT_UNKNOWN >= format)149 {150 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);151 return WINED3DERR_INVALIDCALL;152 }153 154 /* Non-power2 support. */155 if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO))156 {157 pow2_width = width;158 pow2_height = height;159 }160 else161 {162 /* Find the nearest pow2 match. */163 pow2_width = pow2_height = 1;164 while (pow2_width < width) pow2_width <<= 1;165 while (pow2_height < height) pow2_height <<= 1;166 167 if (pow2_width != width || pow2_height != height)168 {169 if (levels > 1)170 {171 WARN("Attempted to create a mipmapped np2 texture without unconditional np2 support.\n");172 return WINED3DERR_INVALIDCALL;173 }174 levels = 1;175 }176 }177 178 /* Calculate levels for mip mapping. */179 if (usage & WINED3DUSAGE_AUTOGENMIPMAP)180 {181 if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))182 {183 WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");184 return WINED3DERR_INVALIDCALL;185 }186 187 if (levels > 1)188 {189 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n");190 return WINED3DERR_INVALIDCALL;191 }192 193 levels = 1;194 }195 else if (!levels)196 {197 levels = wined3d_log2i(max(width, height)) + 1;198 TRACE("Calculated levels = %u.\n", levels);199 }200 201 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,202 WINED3DRTYPE_TEXTURE, device, 0, usage, format_desc, pool, parent);203 if (FAILED(hr))204 {205 WARN("Failed to initialize basetexture, returning %#x.\n", hr);206 return hr;207 }208 209 /* Precalculated scaling for 'faked' non power of two texture coords.210 * Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE211 * is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE212 * doesn't work in combination with ARB_TEXTURE_RECTANGLE. */213 if (GL_SUPPORT(WINE_NORMALIZED_TEXRECT) && (width != pow2_width || height != pow2_height))214 {215 texture->baseTexture.pow2Matrix[0] = 1.0f;216 texture->baseTexture.pow2Matrix[5] = 1.0f;217 texture->baseTexture.pow2Matrix[10] = 1.0f;218 texture->baseTexture.pow2Matrix[15] = 1.0f;219 texture->target = GL_TEXTURE_2D;220 texture->cond_np2 = TRUE;221 texture->baseTexture.minMipLookup = minMipLookup_noFilter;222 }223 else if (GL_SUPPORT(ARB_TEXTURE_RECTANGLE) && (width != pow2_width || height != pow2_height)224 && !((format_desc->format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE)225 && (wined3d_settings.rendertargetlock_mode == RTL_READTEX226 || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX)))227 {228 if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE;229 230 texture->baseTexture.pow2Matrix[0] = (float)width;231 texture->baseTexture.pow2Matrix[5] = (float)height;232 texture->baseTexture.pow2Matrix[10] = 1.0f;233 texture->baseTexture.pow2Matrix[15] = 1.0f;234 texture->target = GL_TEXTURE_RECTANGLE_ARB;235 texture->cond_np2 = TRUE;236 texture->baseTexture.minMipLookup = minMipLookup_noFilter;237 }238 else239 {240 if ((width != pow2_width) || (height != pow2_height))241 {242 texture->baseTexture.pow2Matrix_identity = FALSE;243 texture->baseTexture.pow2Matrix[0] = (((float)width) / ((float)pow2_width));244 texture->baseTexture.pow2Matrix[5] = (((float)height) / ((float)pow2_height));245 }246 else247 {248 texture->baseTexture.pow2Matrix[0] = 1.0f;249 texture->baseTexture.pow2Matrix[5] = 1.0f;250 }251 252 texture->baseTexture.pow2Matrix[10] = 1.0f;253 texture->baseTexture.pow2Matrix[15] = 1.0f;254 texture->target = GL_TEXTURE_2D;255 texture->cond_np2 = FALSE;256 }257 TRACE("xf(%f) yf(%f)\n", texture->baseTexture.pow2Matrix[0], texture->baseTexture.pow2Matrix[5]);258 259 /* Generate all the surfaces. */260 tmp_w = width;261 tmp_h = height;262 for (i = 0; i < texture->baseTexture.levels; ++i)263 {264 /* Use the callback to create the texture surface. */265 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format,266 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]);267 if (FAILED(hr) || ((IWineD3DSurfaceImpl *)texture->surfaces[i])->Flags & SFLAG_OVERSIZE)268 {269 FIXME("Failed to create surface %p, hr %#x\n", texture, hr);270 texture->surfaces[i] = NULL;271 texture_cleanup(texture, D3DCB_DefaultDestroySurface);272 return hr;273 }274 275 IWineD3DSurface_SetContainer(texture->surfaces[i], (IWineD3DBase *)texture);276 TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[i]);277 surface_set_texture_target(texture->surfaces[i], texture->target);278 /* Calculate the next mipmap level. */279 tmp_w = max(1, tmp_w >> 1);280 tmp_h = max(1, tmp_h >> 1);281 }282 texture->baseTexture.internal_preload = texture_internal_preload;283 284 return WINED3D_OK;285 135 } 286 136 … … 321 171 TRACE("(%p) : Releasing from %d\n", This, This->resource.ref); 322 172 ref = InterlockedDecrement(&This->resource.ref); 323 if (ref == 0) { 324 IWineD3DTexture_Destroy(iface, D3DCB_DefaultDestroySurface); 173 if (!ref) 174 { 175 texture_cleanup(This); 176 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 177 HeapFree(GetProcessHeap(), 0, This); 325 178 } 326 179 return ref; … … 432 285 if (set_gl_texture_desc && SUCCEEDED(hr)) { 433 286 UINT i; 287 struct gl_texture *gl_tex; 288 289 if(This->baseTexture.is_srgb) { 290 gl_tex = &This->baseTexture.texture_srgb; 291 } else { 292 gl_tex = &This->baseTexture.texture_rgb; 293 } 294 434 295 for (i = 0; i < This->baseTexture.levels; ++i) { 435 if(This->baseTexture.is_srgb) { 436 surface_set_texture_name(This->surfaces[i], This->baseTexture.srgbTextureName, TRUE); 437 } else { 438 surface_set_texture_name(This->surfaces[i], This->baseTexture.textureName, FALSE); 439 } 296 surface_set_texture_name(This->surfaces[i], gl_tex->name, This->baseTexture.is_srgb); 440 297 } 441 298 /* Conditinal non power of two textures use a different clamping default. If we're using the GL_WINE_normalized_texrect … … 455 312 checkGLcall("glTexParameteri(dimension, GL_TEXTURE_MAG_FILTER, GL_NEAREST)"); 456 313 LEAVE_GL(); 457 This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP;458 This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP;459 This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;460 This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;461 This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;314 gl_tex->states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP; 315 gl_tex->states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP; 316 gl_tex->states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; 317 gl_tex->states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; 318 gl_tex->states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE; 462 319 } 463 320 } … … 483 340 IWineD3DTexture IWineD3DTexture parts follow 484 341 ******************************************* */ 485 static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {486 IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;487 488 texture_cleanup(This, D3DCB_DestroySurface);489 /* free the object */490 HeapFree(GetProcessHeap(), 0, This);491 }492 493 342 static HRESULT WINAPI IWineD3DTextureImpl_GetLevelDesc(IWineD3DTexture *iface, UINT Level, WINED3DSURFACE_DESC* pDesc) { 494 343 IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; … … 553 402 static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, CONST RECT* pDirtyRect) { 554 403 IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; 555 This->baseTexture. dirty = TRUE;556 This->baseTexture. srgbDirty = TRUE;404 This->baseTexture.texture_rgb.dirty = TRUE; 405 This->baseTexture.texture_srgb.dirty = TRUE; 557 406 TRACE("(%p) : dirtyfication of surface Level (0)\n", This); 558 407 surface_add_dirty_rect(This->surfaces[0], pDirtyRect); … … 561 410 } 562 411 563 const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =412 static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl = 564 413 { 565 414 /* IUnknown */ … … 591 440 IWineD3DTextureImpl_IsCondNP2, 592 441 /* IWineD3DTexture */ 593 IWineD3DTextureImpl_Destroy,594 442 IWineD3DTextureImpl_GetLevelDesc, 595 443 IWineD3DTextureImpl_GetSurfaceLevel, … … 598 446 IWineD3DTextureImpl_AddDirtyRect 599 447 }; 448 449 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 450 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 451 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 452 { 453 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 454 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); 455 UINT pow2_width, pow2_height; 456 UINT tmp_w, tmp_h; 457 unsigned int i; 458 HRESULT hr; 459 460 /* TODO: It should only be possible to create textures for formats 461 * that are reported as supported. */ 462 if (WINED3DFMT_UNKNOWN >= format) 463 { 464 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); 465 return WINED3DERR_INVALIDCALL; 466 } 467 468 /* Non-power2 support. */ 469 if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]) 470 { 471 pow2_width = width; 472 pow2_height = height; 473 } 474 else 475 { 476 /* Find the nearest pow2 match. */ 477 pow2_width = pow2_height = 1; 478 while (pow2_width < width) pow2_width <<= 1; 479 while (pow2_height < height) pow2_height <<= 1; 480 481 if (pow2_width != width || pow2_height != height) 482 { 483 if (levels > 1) 484 { 485 WARN("Attempted to create a mipmapped np2 texture without unconditional np2 support.\n"); 486 return WINED3DERR_INVALIDCALL; 487 } 488 levels = 1; 489 } 490 } 491 492 /* Calculate levels for mip mapping. */ 493 if (usage & WINED3DUSAGE_AUTOGENMIPMAP) 494 { 495 if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) 496 { 497 WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); 498 return WINED3DERR_INVALIDCALL; 499 } 500 501 if (levels > 1) 502 { 503 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n"); 504 return WINED3DERR_INVALIDCALL; 505 } 506 507 levels = 1; 508 } 509 else if (!levels) 510 { 511 levels = wined3d_log2i(max(width, height)) + 1; 512 TRACE("Calculated levels = %u.\n", levels); 513 } 514 515 texture->lpVtbl = &IWineD3DTexture_Vtbl; 516 517 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_TEXTURE, 518 device, 0, usage, format_desc, pool, parent, parent_ops); 519 if (FAILED(hr)) 520 { 521 WARN("Failed to initialize basetexture, returning %#x.\n", hr); 522 return hr; 523 } 524 525 /* Precalculated scaling for 'faked' non power of two texture coords. 526 * Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE 527 * is used in combination with texture uploads (RTL_READTEX). The reason is that EXT_PALETTED_TEXTURE 528 * doesn't work in combination with ARB_TEXTURE_RECTANGLE. */ 529 if (gl_info->supported[WINE_NORMALIZED_TEXRECT] && (width != pow2_width || height != pow2_height)) 530 { 531 texture->baseTexture.pow2Matrix[0] = 1.0f; 532 texture->baseTexture.pow2Matrix[5] = 1.0f; 533 texture->baseTexture.pow2Matrix[10] = 1.0f; 534 texture->baseTexture.pow2Matrix[15] = 1.0f; 535 texture->target = GL_TEXTURE_2D; 536 texture->cond_np2 = TRUE; 537 texture->baseTexture.minMipLookup = minMipLookup_noFilter; 538 } 539 else if (gl_info->supported[ARB_TEXTURE_RECTANGLE] && (width != pow2_width || height != pow2_height) 540 && !(format_desc->format == WINED3DFMT_P8_UINT && gl_info->supported[EXT_PALETTED_TEXTURE] 541 && wined3d_settings.rendertargetlock_mode == RTL_READTEX)) 542 { 543 if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE; 544 545 texture->baseTexture.pow2Matrix[0] = (float)width; 546 texture->baseTexture.pow2Matrix[5] = (float)height; 547 texture->baseTexture.pow2Matrix[10] = 1.0f; 548 texture->baseTexture.pow2Matrix[15] = 1.0f; 549 texture->target = GL_TEXTURE_RECTANGLE_ARB; 550 texture->cond_np2 = TRUE; 551 552 if(texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) 553 { 554 texture->baseTexture.minMipLookup = minMipLookup_noMip; 555 } 556 else 557 { 558 texture->baseTexture.minMipLookup = minMipLookup_noFilter; 559 } 560 } 561 else 562 { 563 if ((width != pow2_width) || (height != pow2_height)) 564 { 565 texture->baseTexture.pow2Matrix_identity = FALSE; 566 texture->baseTexture.pow2Matrix[0] = (((float)width) / ((float)pow2_width)); 567 texture->baseTexture.pow2Matrix[5] = (((float)height) / ((float)pow2_height)); 568 } 569 else 570 { 571 texture->baseTexture.pow2Matrix[0] = 1.0f; 572 texture->baseTexture.pow2Matrix[5] = 1.0f; 573 } 574 575 texture->baseTexture.pow2Matrix[10] = 1.0f; 576 texture->baseTexture.pow2Matrix[15] = 1.0f; 577 texture->target = GL_TEXTURE_2D; 578 texture->cond_np2 = FALSE; 579 } 580 TRACE("xf(%f) yf(%f)\n", texture->baseTexture.pow2Matrix[0], texture->baseTexture.pow2Matrix[5]); 581 582 /* Generate all the surfaces. */ 583 tmp_w = width; 584 tmp_h = height; 585 for (i = 0; i < texture->baseTexture.levels; ++i) 586 { 587 /* Use the callback to create the texture surface. */ 588 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 589 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]); 590 if (FAILED(hr) || ((IWineD3DSurfaceImpl *)texture->surfaces[i])->Flags & SFLAG_OVERSIZE) 591 { 592 FIXME("Failed to create surface %p, hr %#x\n", texture, hr); 593 texture->surfaces[i] = NULL; 594 texture_cleanup(texture); 595 return hr; 596 } 597 598 IWineD3DSurface_SetContainer(texture->surfaces[i], (IWineD3DBase *)texture); 599 TRACE("Created surface level %u @ %p.\n", i, texture->surfaces[i]); 600 surface_set_texture_target(texture->surfaces[i], texture->target); 601 /* Calculate the next mipmap level. */ 602 tmp_w = max(1, tmp_w >> 1); 603 tmp_h = max(1, tmp_h >> 1); 604 } 605 texture->baseTexture.internal_preload = texture_internal_preload; 606 607 return WINED3D_OK; 608 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/utils.c
r22496 r23571 8 8 * Copyright 2006-2008 Henri Verbeet 9 9 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 10 * Copyright 2009 Henri Verbeet for CodeWeavers 10 11 * 11 12 * This library is free software; you can redistribute it and/or … … 59 60 static const struct StaticPixelFormatDesc formats[] = 60 61 { 61 /* WINED3DFORMAT alphamask redmask greenmask bluemask bpp depth stencilisFourcc */62 {WINED3DFMT_UNKNOWN, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE},63 /* FourCC formats , kept here to have WINED3DFMT_R8G8B8(=20) at position 20*/64 {WINED3DFMT_UYVY, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },65 {WINED3DFMT_YUY2, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },66 {WINED3DFMT_YV12, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },67 {WINED3DFMT_DXT1, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },68 {WINED3DFMT_DXT2, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },69 {WINED3DFMT_DXT3, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },70 {WINED3DFMT_DXT4, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },71 {WINED3DFMT_DXT5, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },72 {WINED3DFMT_MULTI2_ARGB8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },73 {WINED3DFMT_G8R8_G8B8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },74 {WINED3DFMT_R8G8_B8G8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE },62 /* WINED3DFORMAT alphamask redmask greenmask bluemask bpp depth stencil isFourcc */ 63 {WINED3DFMT_UNKNOWN, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE}, 64 /* FourCC formats */ 65 {WINED3DFMT_UYVY, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE }, 66 {WINED3DFMT_YUY2, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE }, 67 {WINED3DFMT_YV12, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 68 {WINED3DFMT_DXT1, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 69 {WINED3DFMT_DXT2, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 70 {WINED3DFMT_DXT3, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 71 {WINED3DFMT_DXT4, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 72 {WINED3DFMT_DXT5, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 73 {WINED3DFMT_MULTI2_ARGB8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE }, 74 {WINED3DFMT_G8R8_G8B8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE }, 75 {WINED3DFMT_R8G8_B8G8, 0x0, 0x0, 0x0, 0x0, 1/*?*/, 0, 0, TRUE }, 75 76 /* IEEE formats */ 76 {WINED3DFMT_R32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},77 {WINED3DFMT_R32G32_FLOAT, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},78 {WINED3DFMT_R32G32B32_FLOAT, 0x0, 0x0, 0x0, 0x0, 12, 0, 0, FALSE},79 {WINED3DFMT_R32G32B32A32_FLOAT, 0x1, 0x0, 0x0, 0x0, 16, 0, 0, FALSE},77 {WINED3DFMT_R32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 78 {WINED3DFMT_R32G32_FLOAT, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE}, 79 {WINED3DFMT_R32G32B32_FLOAT, 0x0, 0x0, 0x0, 0x0, 12, 0, 0, FALSE}, 80 {WINED3DFMT_R32G32B32A32_FLOAT, 0x1, 0x0, 0x0, 0x0, 16, 0, 0, FALSE}, 80 81 /* Hmm? */ 81 {WINED3DFMT_ CxV8U8,0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},82 {WINED3DFMT_R8G8_SNORM_Cx, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 82 83 /* Float */ 83 {WINED3DFMT_R16_FLOAT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},84 {WINED3DFMT_R16G16_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},85 {WINED3DFMT_R16G16_SINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},86 {WINED3DFMT_R16G16B16A16_FLOAT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},87 {WINED3DFMT_R16G16B16A16_SINT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE},84 {WINED3DFMT_R16_FLOAT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 85 {WINED3DFMT_R16G16_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 86 {WINED3DFMT_R16G16_SINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 87 {WINED3DFMT_R16G16B16A16_FLOAT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE}, 88 {WINED3DFMT_R16G16B16A16_SINT, 0x1, 0x0, 0x0, 0x0, 8, 0, 0, FALSE}, 88 89 /* Palettized formats */ 89 {WINED3DFMT_ A8P8,0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},90 {WINED3DFMT_P8 ,0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},90 {WINED3DFMT_P8_UINT_A8_UNORM, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 91 {WINED3DFMT_P8_UINT, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 91 92 /* Standard ARGB formats. */ 92 {WINED3DFMT_ R8G8B8,0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 3, 0, 0, FALSE},93 {WINED3DFMT_ A8R8G8B8,0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},94 {WINED3DFMT_ X8R8G8B8,0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE},95 {WINED3DFMT_ R5G6B5,0x0, 0x0000f800, 0x000007e0, 0x0000001f, 2, 0, 0, FALSE},96 {WINED3DFMT_ X1R5G5B5,0x0, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},97 {WINED3DFMT_ A1R5G5B5,0x00008000, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE},98 {WINED3DFMT_ A4R4G4B4,0x0000f000, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},99 {WINED3DFMT_ R3G3B2,0x0, 0x000000e0, 0x0000001c, 0x00000003, 1, 0, 0, FALSE},100 {WINED3DFMT_A8_UNORM, 0x000000ff, 0x0, 0x0, 0x0, 1, 0, 0, FALSE},101 {WINED3DFMT_ A8R3G3B2,0x0000ff00, 0x000000e0, 0x0000001c, 0x00000003, 2, 0, 0, FALSE},102 {WINED3DFMT_ X4R4G4B4,0x0, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE},103 {WINED3DFMT_R10G10B10A2_UNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},104 {WINED3DFMT_R10G10B10A2_UINT, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},105 {WINED3DFMT_R10G10B10A2_SNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE},106 {WINED3DFMT_R8G8B8A8_UNORM, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},107 {WINED3DFMT_R8G8B8A8_UINT, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},108 {WINED3DFMT_ X8B8G8R8,0x0, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE},109 {WINED3DFMT_R16G16_UNORM, 0x0, 0x0000ffff, 0xffff0000, 0x0, 4, 0, 0, FALSE},110 {WINED3DFMT_ A2R10G10B10,0xc0000000, 0x3ff00000, 0x000ffc00, 0x000003ff, 4, 0, 0, FALSE},111 {WINED3DFMT_R16G16B16A16_UNORM, 0x1, 0x0000ffff, 0xffff0000, 0x0, 8, 0, 0, FALSE},93 {WINED3DFMT_B8G8R8_UNORM, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 3, 0, 0, FALSE}, 94 {WINED3DFMT_B8G8R8A8_UNORM, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE}, 95 {WINED3DFMT_B8G8R8X8_UNORM, 0x0, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, 0, 0, FALSE}, 96 {WINED3DFMT_B5G6R5_UNORM, 0x0, 0x0000f800, 0x000007e0, 0x0000001f, 2, 0, 0, FALSE}, 97 {WINED3DFMT_B5G5R5X1_UNORM, 0x0, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE}, 98 {WINED3DFMT_B5G5R5A1_UNORM, 0x00008000, 0x00007c00, 0x000003e0, 0x0000001f, 2, 0, 0, FALSE}, 99 {WINED3DFMT_B4G4R4A4_UNORM, 0x0000f000, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE}, 100 {WINED3DFMT_B2G3R3_UNORM, 0x0, 0x000000e0, 0x0000001c, 0x00000003, 1, 0, 0, FALSE}, 101 {WINED3DFMT_A8_UNORM, 0x000000ff, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 102 {WINED3DFMT_B2G3R3A8_UNORM, 0x0000ff00, 0x000000e0, 0x0000001c, 0x00000003, 2, 0, 0, FALSE}, 103 {WINED3DFMT_B4G4R4X4_UNORM, 0x0, 0x00000f00, 0x000000f0, 0x0000000f, 2, 0, 0, FALSE}, 104 {WINED3DFMT_R10G10B10A2_UNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE}, 105 {WINED3DFMT_R10G10B10A2_UINT, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE}, 106 {WINED3DFMT_R10G10B10A2_SNORM, 0xc0000000, 0x000003ff, 0x000ffc00, 0x3ff00000, 4, 0, 0, FALSE}, 107 {WINED3DFMT_R8G8B8A8_UNORM, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE}, 108 {WINED3DFMT_R8G8B8A8_UINT, 0xff000000, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE}, 109 {WINED3DFMT_R8G8B8X8_UNORM, 0x0, 0x000000ff, 0x0000ff00, 0x00ff0000, 4, 0, 0, FALSE}, 110 {WINED3DFMT_R16G16_UNORM, 0x0, 0x0000ffff, 0xffff0000, 0x0, 4, 0, 0, FALSE}, 111 {WINED3DFMT_B10G10R10A2_UNORM, 0xc0000000, 0x3ff00000, 0x000ffc00, 0x000003ff, 4, 0, 0, FALSE}, 112 {WINED3DFMT_R16G16B16A16_UNORM, 0x1, 0x0000ffff, 0xffff0000, 0x0, 8, 0, 0, FALSE}, 112 113 /* Luminance */ 113 {WINED3DFMT_L8, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 114 {WINED3DFMT_A8L8, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 115 {WINED3DFMT_A4L4, 0x000000f0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 114 {WINED3DFMT_L8_UNORM, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 115 {WINED3DFMT_L8A8_UNORM, 0x0000ff00, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 116 {WINED3DFMT_L4A4_UNORM, 0x000000f0, 0x0, 0x0, 0x0, 1, 0, 0, FALSE}, 117 {WINED3DFMT_L16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 116 118 /* Bump mapping stuff */ 117 {WINED3DFMT_R8G8_SNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},118 {WINED3DFMT_ L6V5U5,0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE},119 {WINED3DFMT_ X8L8V8U8,0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},120 {WINED3DFMT_R8G8B8A8_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},121 {WINED3DFMT_R16G16_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},122 {WINED3DFMT_ W11V11U10,0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE},123 {WINED3DFMT_ A2W10V10U10, 0xb0000000,0x0, 0x0, 0x0, 4, 0, 0, FALSE},119 {WINED3DFMT_R8G8_SNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 120 {WINED3DFMT_R5G5_SNORM_L6_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 121 {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 122 {WINED3DFMT_R8G8B8A8_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 123 {WINED3DFMT_R16G16_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 124 {WINED3DFMT_R10G11B11_SNORM, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 125 {WINED3DFMT_R10G10B10_SNORM_A2_UNORM,0xb0000000,0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 124 126 /* Depth stencil formats */ 125 {WINED3DFMT_D16_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 126 {WINED3DFMT_D32, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE}, 127 {WINED3DFMT_D15S1, 0x0, 0x0, 0x0, 0x0, 2, 15, 1, FALSE}, 128 {WINED3DFMT_D24S8, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE}, 129 {WINED3DFMT_D24X8, 0x0, 0x0, 0x0, 0x0, 4, 24, 0, FALSE}, 130 {WINED3DFMT_D24X4S4, 0x0, 0x0, 0x0, 0x0, 4, 24, 4, FALSE}, 131 {WINED3DFMT_D16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 132 {WINED3DFMT_L16, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 133 {WINED3DFMT_D32F_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE}, 134 {WINED3DFMT_D24FS8, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE}, 135 /* Is this a vertex buffer? */ 136 {WINED3DFMT_VERTEXDATA, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE}, 137 {WINED3DFMT_R16_UINT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 138 {WINED3DFMT_R32_UINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 139 {WINED3DFMT_R16G16B16A16_SNORM, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE}, 127 {WINED3DFMT_D16_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 128 {WINED3DFMT_D32_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE}, 129 {WINED3DFMT_S1_UINT_D15_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 15, 1, FALSE}, 130 {WINED3DFMT_S8_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE}, 131 {WINED3DFMT_X8D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 0, FALSE}, 132 {WINED3DFMT_S4X4_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 4, FALSE}, 133 {WINED3DFMT_D16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE}, 134 {WINED3DFMT_D32_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE}, 135 {WINED3DFMT_S8_UINT_D24_FLOAT, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE}, 136 {WINED3DFMT_VERTEXDATA, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, FALSE}, 137 {WINED3DFMT_R16_UINT, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, FALSE}, 138 {WINED3DFMT_R32_UINT, 0x0, 0x0, 0x0, 0x0, 4, 0, 0, FALSE}, 139 {WINED3DFMT_R16G16B16A16_SNORM, 0x0, 0x0, 0x0, 0x0, 8, 0, 0, FALSE}, 140 140 /* Vendor-specific formats */ 141 {WINED3DFMT_ATI2N, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE },142 {WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },143 {WINED3DFMT_NVHS, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE },141 {WINED3DFMT_ATI2N, 0x0, 0x0, 0x0, 0x0, 1, 0, 0, TRUE }, 142 {WINED3DFMT_NVHU, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE }, 143 {WINED3DFMT_NVHS, 0x0, 0x0, 0x0, 0x0, 2, 0, 0, TRUE }, 144 144 }; 145 145 … … 179 179 {WINED3DFMT_R32G32B32_FLOAT, WINED3D_FFP_EMIT_FLOAT3, 3, GL_FLOAT, 3, GL_FALSE, sizeof(float)}, 180 180 {WINED3DFMT_R32G32B32A32_FLOAT, WINED3D_FFP_EMIT_FLOAT4, 4, GL_FLOAT, 4, GL_FALSE, sizeof(float)}, 181 {WINED3DFMT_ A8R8G8B8,WINED3D_FFP_EMIT_D3DCOLOR, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)},181 {WINED3DFMT_B8G8R8A8_UNORM, WINED3D_FFP_EMIT_D3DCOLOR, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)}, 182 182 {WINED3DFMT_R8G8B8A8_UINT, WINED3D_FFP_EMIT_UBYTE4, 4, GL_UNSIGNED_BYTE, 4, GL_FALSE, sizeof(BYTE)}, 183 183 {WINED3DFMT_R16G16_SINT, WINED3D_FFP_EMIT_SHORT2, 2, GL_SHORT, 2, GL_FALSE, sizeof(short int)}, … … 208 208 */ 209 209 static const GlPixelFormatDescTemplate gl_formats_template[] = { 210 /* WINED3DFORMAT internal srgbInternalrtInternal211 format type210 /* WINED3DFORMAT internal srgbInternal rtInternal 211 format type 212 212 flags 213 213 extension */ … … 219 219 * endian machine 220 220 */ 221 {WINED3DFMT_UYVY, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,222 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,221 {WINED3DFMT_UYVY, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0, 222 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 223 223 WINED3DFMT_FLAG_FILTERING, 224 224 WINED3D_GL_EXT_NONE}, 225 {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0,226 GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_APPLE,225 {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, 226 GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_APPLE, 227 227 WINED3DFMT_FLAG_FILTERING, 228 228 APPLE_YCBCR_422}, 229 {WINED3DFMT_YUY2, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0,230 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,229 {WINED3DFMT_YUY2, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0, 230 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 231 231 WINED3DFMT_FLAG_FILTERING, 232 232 WINED3D_GL_EXT_NONE}, 233 {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0,234 GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_REV_APPLE,233 {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0, 234 GL_YCBCR_422_APPLE, UNSIGNED_SHORT_8_8_REV_APPLE, 235 235 WINED3DFMT_FLAG_FILTERING, 236 236 APPLE_YCBCR_422}, 237 {WINED3DFMT_YV12, GL_ALPHA, GL_ALPHA, 0,238 GL_ALPHA, GL_UNSIGNED_BYTE,237 {WINED3DFMT_YV12, GL_ALPHA, GL_ALPHA, 0, 238 GL_ALPHA, GL_UNSIGNED_BYTE, 239 239 WINED3DFMT_FLAG_FILTERING, 240 240 WINED3D_GL_EXT_NONE}, 241 {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0,242 GL_RGBA, GL_UNSIGNED_BYTE,241 {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, 242 GL_RGBA, GL_UNSIGNED_BYTE, 243 243 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 244 244 EXT_TEXTURE_COMPRESSION_S3TC}, 245 {WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,246 GL_RGBA, GL_UNSIGNED_BYTE,245 {WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, 246 GL_RGBA, GL_UNSIGNED_BYTE, 247 247 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 248 248 EXT_TEXTURE_COMPRESSION_S3TC}, 249 {WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0,250 GL_RGBA, GL_UNSIGNED_BYTE,249 {WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, 250 GL_RGBA, GL_UNSIGNED_BYTE, 251 251 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 252 252 EXT_TEXTURE_COMPRESSION_S3TC}, 253 {WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,254 GL_RGBA, GL_UNSIGNED_BYTE,253 {WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, 254 GL_RGBA, GL_UNSIGNED_BYTE, 255 255 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 256 256 EXT_TEXTURE_COMPRESSION_S3TC}, 257 {WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0,258 GL_RGBA, GL_UNSIGNED_BYTE,257 {WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, 258 GL_RGBA, GL_UNSIGNED_BYTE, 259 259 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 260 260 EXT_TEXTURE_COMPRESSION_S3TC}, 261 261 /* IEEE formats */ 262 {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,263 GL_RED, GL_FLOAT,262 {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, 263 GL_RED, GL_FLOAT, 264 264 WINED3DFMT_FLAG_RENDERTARGET, 265 265 ARB_TEXTURE_FLOAT}, 266 {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0,267 GL_RED, GL_FLOAT,266 {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, 267 GL_RED, GL_FLOAT, 268 268 WINED3DFMT_FLAG_RENDERTARGET, 269 269 ARB_TEXTURE_RG}, 270 {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0,271 GL_RGB, GL_FLOAT,270 {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, 271 GL_RGB, GL_FLOAT, 272 272 WINED3DFMT_FLAG_RENDERTARGET, 273 273 ARB_TEXTURE_FLOAT}, 274 {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0,275 GL_RG, GL_FLOAT,274 {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, 275 GL_RG, GL_FLOAT, 276 276 WINED3DFMT_FLAG_RENDERTARGET, 277 277 ARB_TEXTURE_RG}, 278 {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0,279 GL_RGBA, GL_FLOAT,278 {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, 279 GL_RGBA, GL_FLOAT, 280 280 WINED3DFMT_FLAG_RENDERTARGET, 281 281 ARB_TEXTURE_FLOAT}, 282 282 /* Float */ 283 {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,284 GL_RED, GL_HALF_FLOAT_ARB,283 {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, 284 GL_RED, GL_HALF_FLOAT_ARB, 285 285 WINED3DFMT_FLAG_RENDERTARGET, 286 286 ARB_TEXTURE_FLOAT}, 287 {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0,288 GL_RED, GL_HALF_FLOAT_ARB,287 {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, 288 GL_RED, GL_HALF_FLOAT_ARB, 289 289 WINED3DFMT_FLAG_RENDERTARGET, 290 290 ARB_TEXTURE_RG}, 291 {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0,292 GL_RGB, GL_HALF_FLOAT_ARB,291 {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, 292 GL_RGB, GL_HALF_FLOAT_ARB, 293 293 WINED3DFMT_FLAG_RENDERTARGET, 294 294 ARB_TEXTURE_FLOAT}, 295 {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0,296 GL_RG, GL_HALF_FLOAT_ARB,295 {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, 296 GL_RG, GL_HALF_FLOAT_ARB, 297 297 WINED3DFMT_FLAG_RENDERTARGET, 298 298 ARB_TEXTURE_RG}, 299 {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0,300 GL_RGBA, GL_HALF_FLOAT_ARB,299 {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, 300 GL_RGBA, GL_HALF_FLOAT_ARB, 301 301 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, 302 302 ARB_TEXTURE_FLOAT}, 303 303 /* Palettized formats */ 304 {WINED3DFMT_P8 ,GL_RGBA, GL_RGBA, 0,305 GL_RGBA, GL_UNSIGNED_BYTE,306 0,304 {WINED3DFMT_P8_UINT, GL_RGBA, GL_RGBA, 0, 305 GL_RGBA, GL_UNSIGNED_BYTE, 306 WINED3DFMT_FLAG_GETDC, 307 307 ARB_FRAGMENT_PROGRAM}, 308 {WINED3DFMT_P8 ,GL_COLOR_INDEX8_EXT, GL_COLOR_INDEX8_EXT, 0,309 GL_COLOR_INDEX, GL_UNSIGNED_BYTE,310 0,308 {WINED3DFMT_P8_UINT, GL_COLOR_INDEX8_EXT, GL_COLOR_INDEX8_EXT, 0, 309 GL_COLOR_INDEX, GL_UNSIGNED_BYTE, 310 WINED3DFMT_FLAG_GETDC, 311 311 EXT_PALETTED_TEXTURE}, 312 312 /* Standard ARGB formats */ 313 {WINED3DFMT_R8G8B8, GL_RGB8, GL_RGB8, 0, 314 GL_BGR, GL_UNSIGNED_BYTE, 315 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, 313 {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, 314 GL_BGR, GL_UNSIGNED_BYTE, 315 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | 316 WINED3DFMT_FLAG_GETDC, 316 317 WINED3D_GL_EXT_NONE}, 317 {WINED3DFMT_A8R8G8B8, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, 318 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 319 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, 318 {WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, 319 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 320 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | 321 WINED3DFMT_FLAG_GETDC, 320 322 WINED3D_GL_EXT_NONE}, 321 {WINED3DFMT_X8R8G8B8, GL_RGB8, GL_SRGB8_EXT, 0, 322 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 323 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, 323 {WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0, 324 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 325 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | 326 WINED3DFMT_FLAG_GETDC, 324 327 WINED3D_GL_EXT_NONE}, 325 {WINED3DFMT_R5G6B5, GL_RGB5, GL_RGB5, GL_RGB8, 326 GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 327 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, 328 {WINED3DFMT_B5G6R5_UNORM, GL_RGB5, GL_RGB5, GL_RGB8, 329 GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 330 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | 331 WINED3DFMT_FLAG_GETDC, 328 332 WINED3D_GL_EXT_NONE}, 329 {WINED3DFMT_X1R5G5B5, GL_RGB5, GL_RGB5_A1, 0, 330 GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 333 {WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5_A1, 0, 334 GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 335 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | 336 WINED3DFMT_FLAG_GETDC, 337 WINED3D_GL_EXT_NONE}, 338 {WINED3DFMT_B5G5R5A1_UNORM, GL_RGB5_A1, GL_RGB5_A1, 0, 339 GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 340 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | 341 WINED3DFMT_FLAG_GETDC, 342 WINED3D_GL_EXT_NONE}, 343 {WINED3DFMT_B4G4R4A4_UNORM, GL_RGBA4, GL_SRGB8_ALPHA8_EXT, 0, 344 GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 345 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | 346 WINED3DFMT_FLAG_GETDC, 347 WINED3D_GL_EXT_NONE}, 348 {WINED3DFMT_B2G3R3_UNORM, GL_R3_G3_B2, GL_R3_G3_B2, 0, 349 GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 350 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING, 351 WINED3D_GL_EXT_NONE}, 352 {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, 353 GL_ALPHA, GL_UNSIGNED_BYTE, 354 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING, 355 WINED3D_GL_EXT_NONE}, 356 {WINED3DFMT_B4G4R4X4_UNORM, GL_RGB4, GL_RGB4, 0, 357 GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 358 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC, 359 WINED3D_GL_EXT_NONE}, 360 {WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, 361 GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 331 362 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 332 363 WINED3D_GL_EXT_NONE}, 333 {WINED3DFMT_A1R5G5B5, GL_RGB5_A1, GL_RGB5_A1, 0, 334 GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 364 {WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_RGBA8, 0, 365 GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 366 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC, 367 WINED3D_GL_EXT_NONE}, 368 {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, 369 GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 370 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_GETDC, 371 WINED3D_GL_EXT_NONE}, 372 {WINED3DFMT_R16G16_UNORM, GL_RGB16_EXT, GL_RGB16_EXT, GL_RGBA16_EXT, 373 GL_RGB, GL_UNSIGNED_SHORT, 335 374 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 336 375 WINED3D_GL_EXT_NONE}, 337 {WINED3DFMT_ A4R4G4B4, GL_RGBA4, GL_SRGB8_ALPHA8_EXT,0,338 GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV,376 {WINED3DFMT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, 377 GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 339 378 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 340 379 WINED3D_GL_EXT_NONE}, 341 {WINED3DFMT_R3G3B2, GL_R3_G3_B2, GL_R3_G3_B2, 0, 342 GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 343 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING, 344 WINED3D_GL_EXT_NONE}, 345 {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, 346 GL_ALPHA, GL_UNSIGNED_BYTE, 347 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING, 348 WINED3D_GL_EXT_NONE}, 349 {WINED3DFMT_X4R4G4B4, GL_RGB4, GL_RGB4, 0, 350 GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 351 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 352 WINED3D_GL_EXT_NONE}, 353 {WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, 354 GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 355 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 356 WINED3D_GL_EXT_NONE}, 357 {WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_RGBA8, 0, 358 GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 359 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 360 WINED3D_GL_EXT_NONE}, 361 {WINED3DFMT_X8B8G8R8, GL_RGB8, GL_RGB8, 0, 362 GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 363 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 364 WINED3D_GL_EXT_NONE}, 365 {WINED3DFMT_R16G16_UNORM, GL_RGB16_EXT, GL_RGB16_EXT, GL_RGBA16_EXT, 366 GL_RGB, GL_UNSIGNED_SHORT, 367 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 368 WINED3D_GL_EXT_NONE}, 369 {WINED3DFMT_A2R10G10B10, GL_RGB10_A2, GL_RGB10_A2, 0, 370 GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 371 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 372 WINED3D_GL_EXT_NONE}, 373 {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16_EXT, GL_RGBA16_EXT, 0, 374 GL_RGBA, GL_UNSIGNED_SHORT, 380 {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16_EXT, GL_RGBA16_EXT, 0, 381 GL_RGBA, GL_UNSIGNED_SHORT, 375 382 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, 376 383 WINED3D_GL_EXT_NONE}, 377 384 /* Luminance */ 378 {WINED3DFMT_L8 ,GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0,379 GL_LUMINANCE, GL_UNSIGNED_BYTE,385 {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, 386 GL_LUMINANCE, GL_UNSIGNED_BYTE, 380 387 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 381 388 WINED3D_GL_EXT_NONE}, 382 {WINED3DFMT_ A8L8,GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0,383 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,389 {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, 390 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 384 391 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 385 392 WINED3D_GL_EXT_NONE}, 386 {WINED3DFMT_ A4L4,GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0,387 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,393 {WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0, 394 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 388 395 0, 389 396 WINED3D_GL_EXT_NONE}, 390 397 /* Bump mapping stuff */ 391 {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0,392 GL_BGR, GL_UNSIGNED_BYTE,398 {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0, 399 GL_BGR, GL_UNSIGNED_BYTE, 393 400 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 394 401 WINED3D_GL_EXT_NONE}, 395 {WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0,396 GL_DSDT_NV, GL_BYTE,402 {WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0, 403 GL_DSDT_NV, GL_BYTE, 397 404 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 398 405 NV_TEXTURE_SHADER}, 399 {WINED3DFMT_ L6V5U5,GL_RGB5, GL_RGB5, 0,400 GL_RGB, GL_UNSIGNED_SHORT_5_6_5,406 {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0, 407 GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 401 408 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 402 409 WINED3D_GL_EXT_NONE}, 403 {WINED3DFMT_ L6V5U5,GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0,404 GL_DSDT_MAG_NV, GL_BYTE,410 {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0, 411 GL_DSDT_MAG_NV, GL_BYTE, 405 412 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 406 413 NV_TEXTURE_SHADER}, 407 {WINED3DFMT_ X8L8V8U8,GL_RGB8, GL_RGB8, 0,408 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,414 {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0, 415 GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 409 416 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 410 417 WINED3D_GL_EXT_NONE}, 411 {WINED3DFMT_ X8L8V8U8,GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0,412 GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV,418 {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0, 419 GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV, 413 420 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 414 421 NV_TEXTURE_SHADER}, 415 {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0,416 GL_BGRA, GL_UNSIGNED_BYTE,422 {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0, 423 GL_BGRA, GL_UNSIGNED_BYTE, 417 424 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 418 425 WINED3D_GL_EXT_NONE}, 419 {WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0,420 GL_RGBA, GL_BYTE,426 {WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0, 427 GL_RGBA, GL_BYTE, 421 428 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 422 429 NV_TEXTURE_SHADER}, 423 {WINED3DFMT_R16G16_SNORM, GL_RGB16_EXT, GL_RGB16_EXT, 0,424 GL_BGR, GL_UNSIGNED_SHORT,430 {WINED3DFMT_R16G16_SNORM, GL_RGB16_EXT, GL_RGB16_EXT, 0, 431 GL_BGR, GL_UNSIGNED_SHORT, 425 432 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 426 433 WINED3D_GL_EXT_NONE}, 427 {WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0,428 GL_HILO_NV, GL_SHORT,434 {WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0, 435 GL_HILO_NV, GL_SHORT, 429 436 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 430 437 NV_TEXTURE_SHADER}, 431 438 /* Depth stencil formats */ 432 {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,433 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,439 {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 440 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 434 441 WINED3DFMT_FLAG_DEPTH, 435 442 ARB_DEPTH_TEXTURE}, 436 {WINED3DFMT_D32 ,GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT32_ARB, 0,437 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,443 {WINED3DFMT_D32_UNORM, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT32_ARB, 0, 444 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 438 445 WINED3DFMT_FLAG_DEPTH, 439 446 ARB_DEPTH_TEXTURE}, 440 {WINED3DFMT_ D15S1,GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,441 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,447 {WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 448 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 442 449 WINED3DFMT_FLAG_DEPTH, 443 450 ARB_DEPTH_TEXTURE}, 444 {WINED3DFMT_ D15S1,GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,445 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,451 {WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0, 452 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 446 453 WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 447 454 EXT_PACKED_DEPTH_STENCIL}, 448 {WINED3DFMT_D24S8, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 449 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 455 {WINED3DFMT_S1_UINT_D15_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, 456 GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 457 WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 458 ARB_FRAMEBUFFER_OBJECT}, 459 {WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 460 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 450 461 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH, 451 462 ARB_DEPTH_TEXTURE}, 452 {WINED3DFMT_ D24S8,GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,453 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,463 {WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0, 464 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 454 465 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 455 466 EXT_PACKED_DEPTH_STENCIL}, 456 {WINED3DFMT_D24X8, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 457 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 467 {WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, 468 GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 469 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 470 ARB_FRAMEBUFFER_OBJECT}, 471 {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 472 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 458 473 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH, 459 474 ARB_DEPTH_TEXTURE}, 460 {WINED3DFMT_ D24X4S4,GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,461 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,475 {WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 476 GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 462 477 WINED3DFMT_FLAG_DEPTH, 463 478 ARB_DEPTH_TEXTURE}, 464 {WINED3DFMT_ D24X4S4,GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,465 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,479 {WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0, 480 GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 466 481 WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 467 482 EXT_PACKED_DEPTH_STENCIL}, 468 {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 469 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 483 {WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, 484 GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 485 WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 486 ARB_FRAMEBUFFER_OBJECT}, 487 {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, 488 GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 470 489 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH, 471 490 ARB_DEPTH_TEXTURE}, 472 {WINED3DFMT_L16 ,GL_LUMINANCE16_EXT, GL_LUMINANCE16_EXT, 0,473 GL_LUMINANCE, GL_UNSIGNED_SHORT,491 {WINED3DFMT_L16_UNORM, GL_LUMINANCE16_EXT, GL_LUMINANCE16_EXT, 0, 492 GL_LUMINANCE, GL_UNSIGNED_SHORT, 474 493 WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, 475 494 WINED3D_GL_EXT_NONE}, 476 {WINED3DFMT_D32 F_LOCKABLE,GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0,477 GL_DEPTH_COMPONENT, GL_FLOAT,495 {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, 496 GL_DEPTH_COMPONENT, GL_FLOAT, 478 497 WINED3DFMT_FLAG_DEPTH, 479 498 ARB_DEPTH_BUFFER_FLOAT}, 480 {WINED3DFMT_ D24FS8,GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0,481 GL_DEPTH_STENCIL _EXT,GL_FLOAT_32_UNSIGNED_INT_24_8_REV,499 {WINED3DFMT_S8_UINT_D24_FLOAT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0, 500 GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 482 501 WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL, 483 502 ARB_DEPTH_BUFFER_FLOAT}, 484 503 /* Vendor-specific formats */ 485 {WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0,486 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,504 {WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0, 505 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 487 506 0, 488 507 ATI_TEXTURE_COMPRESSION_3DC}, 489 {WINED3DFMT_ATI2N, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, 0,490 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,508 {WINED3DFMT_ATI2N, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, GL_COMPRESSED_RED_GREEN_RGTC2_EXT, 0, 509 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 491 510 0, 492 511 EXT_TEXTURE_COMPRESSION_RGTC}, … … 590 609 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 591 610 592 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0));593 594 status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));611 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0); 612 613 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER); 595 614 checkGLcall("Framebuffer format check"); 596 615 597 if (status == GL_FRAMEBUFFER_COMPLETE _EXT)616 if (status == GL_FRAMEBUFFER_COMPLETE) 598 617 { 599 618 TRACE("Format %s is supported as FBO color attachment\n", debug_d3dformat(format_desc->format)); … … 624 643 while(glGetError()); 625 644 626 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, 0, 0));645 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); 627 646 628 647 glTexImage2D(GL_TEXTURE_2D, 0, format_desc->rtInternal, 16, 16, 0, … … 631 650 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 632 651 633 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0));634 635 status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));652 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0); 653 654 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER); 636 655 checkGLcall("Framebuffer format check"); 637 656 638 if (status == GL_FRAMEBUFFER_COMPLETE _EXT)657 if (status == GL_FRAMEBUFFER_COMPLETE) 639 658 { 640 659 TRACE("Format %s rtInternal format is supported as FBO color attachment\n", … … 650 669 } 651 670 652 if (status == GL_FRAMEBUFFER_COMPLETE _EXT&& format_desc->Flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)671 if (status == GL_FRAMEBUFFER_COMPLETE && format_desc->Flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) 653 672 { 654 673 GLuint rb; 655 674 656 if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 675 if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT) 676 || GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 657 677 { 658 GL_EXTCALL(glGenRenderbuffersEXT(1, &rb)); 659 GL_EXTCALL(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb)); 660 GL_EXTCALL(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, 16, 16)); 661 GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, 662 GL_RENDERBUFFER_EXT, rb)); 663 GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, 664 GL_RENDERBUFFER_EXT, rb)); 678 gl_info->fbo_ops.glGenRenderbuffers(1, &rb); 679 gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, rb); 680 gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 16, 16); 681 gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rb); 682 gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb); 665 683 checkGLcall("RB attachment"); 666 684 } … … 668 686 glEnable(GL_BLEND); 669 687 glClear(GL_COLOR_BUFFER_BIT); 670 if (glGetError() == GL_INVALID_FRAMEBUFFER_OPERATION _EXT)688 if (glGetError() == GL_INVALID_FRAMEBUFFER_OPERATION) 671 689 { 672 690 while(glGetError()); … … 675 693 } 676 694 677 if (GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 695 if (GL_SUPPORT(ARB_FRAMEBUFFER_OBJECT) 696 || GL_SUPPORT(EXT_PACKED_DEPTH_STENCIL)) 678 697 { 679 GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, 680 GL_RENDERBUFFER_EXT, 0)); 681 GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, 682 GL_RENDERBUFFER_EXT, 0)); 683 GL_EXTCALL(glDeleteRenderbuffersEXT(1, &rb)); 698 gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0); 699 gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0); 700 gl_info->fbo_ops.glDeleteRenderbuffers(1, &rb); 684 701 checkGLcall("RB cleanup"); 685 702 } … … 701 718 ENTER_GL(); 702 719 703 GL_EXTCALL(glGenFramebuffersEXT(1, &fbo));704 GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo));720 gl_info->fbo_ops.glGenFramebuffers(1, &fbo); 721 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo); 705 722 706 723 LEAVE_GL(); … … 742 759 ENTER_GL(); 743 760 744 GL_EXTCALL(glDeleteFramebuffersEXT(1, &fbo));761 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo); 745 762 746 763 LEAVE_GL(); … … 833 850 glEnable(GL_TEXTURE_2D); 834 851 835 GL_EXTCALL(glGenFramebuffersEXT(1, &fbo));836 GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo));837 GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, buffer, 0));838 glDrawBuffer(GL_COLOR_ATTACHMENT0 _EXT);852 gl_info->fbo_ops.glGenFramebuffers(1, &fbo); 853 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo); 854 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, buffer, 0); 855 glDrawBuffer(GL_COLOR_ATTACHMENT0); 839 856 840 857 glViewport(0, 0, 16, 1); … … 876 893 } 877 894 878 GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));879 GL_EXTCALL(glDeleteFramebuffersEXT(1, &fbo));895 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0); 896 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo); 880 897 glDeleteTextures(1, &tex); 881 898 glDeleteTextures(1, &buffer); … … 1007 1024 * with each other 1008 1025 */ 1009 idx = getFmtIdx(WINED3DFMT_ L6V5U5);1026 idx = getFmtIdx(WINED3DFMT_R5G5_SNORM_L6_UNORM); 1010 1027 gl_info->gl_formats[idx].color_fixup = create_color_fixup_desc( 1011 1028 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE); 1012 idx = getFmtIdx(WINED3DFMT_ X8L8V8U8);1029 idx = getFmtIdx(WINED3DFMT_R8G8_SNORM_L8X8_UNORM); 1013 1030 gl_info->gl_formats[idx].color_fixup = create_color_fixup_desc( 1014 1031 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W); … … 1054 1071 if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)) 1055 1072 { 1056 idx = getFmtIdx(WINED3DFMT_ A8R8G8B8);1073 idx = getFmtIdx(WINED3DFMT_B8G8R8A8_UNORM); 1057 1074 gl_info->gl_formats[idx].gl_vtx_format = GL_BGRA; 1058 1075 } … … 1155 1172 #define FMT_TO_STR(fmt) case fmt: return #fmt 1156 1173 FMT_TO_STR(WINED3DFMT_UNKNOWN); 1157 FMT_TO_STR(WINED3DFMT_R8G8B8); 1158 FMT_TO_STR(WINED3DFMT_A8R8G8B8); 1159 FMT_TO_STR(WINED3DFMT_X8R8G8B8); 1160 FMT_TO_STR(WINED3DFMT_R5G6B5); 1161 FMT_TO_STR(WINED3DFMT_X1R5G5B5); 1162 FMT_TO_STR(WINED3DFMT_A1R5G5B5); 1163 FMT_TO_STR(WINED3DFMT_A4R4G4B4); 1164 FMT_TO_STR(WINED3DFMT_R3G3B2); 1165 FMT_TO_STR(WINED3DFMT_A8R3G3B2); 1166 FMT_TO_STR(WINED3DFMT_X4R4G4B4); 1167 FMT_TO_STR(WINED3DFMT_X8B8G8R8); 1168 FMT_TO_STR(WINED3DFMT_A2R10G10B10); 1169 FMT_TO_STR(WINED3DFMT_A8P8); 1170 FMT_TO_STR(WINED3DFMT_P8); 1171 FMT_TO_STR(WINED3DFMT_L8); 1172 FMT_TO_STR(WINED3DFMT_A8L8); 1173 FMT_TO_STR(WINED3DFMT_A4L4); 1174 FMT_TO_STR(WINED3DFMT_L6V5U5); 1175 FMT_TO_STR(WINED3DFMT_X8L8V8U8); 1176 FMT_TO_STR(WINED3DFMT_W11V11U10); 1177 FMT_TO_STR(WINED3DFMT_A2W10V10U10); 1174 FMT_TO_STR(WINED3DFMT_B8G8R8_UNORM); 1175 FMT_TO_STR(WINED3DFMT_B5G5R5X1_UNORM); 1176 FMT_TO_STR(WINED3DFMT_B4G4R4A4_UNORM); 1177 FMT_TO_STR(WINED3DFMT_B2G3R3_UNORM); 1178 FMT_TO_STR(WINED3DFMT_B2G3R3A8_UNORM); 1179 FMT_TO_STR(WINED3DFMT_B4G4R4X4_UNORM); 1180 FMT_TO_STR(WINED3DFMT_R8G8B8X8_UNORM); 1181 FMT_TO_STR(WINED3DFMT_B10G10R10A2_UNORM); 1182 FMT_TO_STR(WINED3DFMT_P8_UINT_A8_UNORM); 1183 FMT_TO_STR(WINED3DFMT_P8_UINT); 1184 FMT_TO_STR(WINED3DFMT_L8_UNORM); 1185 FMT_TO_STR(WINED3DFMT_L8A8_UNORM); 1186 FMT_TO_STR(WINED3DFMT_L4A4_UNORM); 1187 FMT_TO_STR(WINED3DFMT_R5G5_SNORM_L6_UNORM); 1188 FMT_TO_STR(WINED3DFMT_R8G8_SNORM_L8X8_UNORM); 1189 FMT_TO_STR(WINED3DFMT_R10G11B11_SNORM); 1190 FMT_TO_STR(WINED3DFMT_R10G10B10_SNORM_A2_UNORM); 1178 1191 FMT_TO_STR(WINED3DFMT_UYVY); 1179 1192 FMT_TO_STR(WINED3DFMT_YUY2); … … 1188 1201 FMT_TO_STR(WINED3DFMT_R8G8_B8G8); 1189 1202 FMT_TO_STR(WINED3DFMT_D16_LOCKABLE); 1190 FMT_TO_STR(WINED3DFMT_D32); 1191 FMT_TO_STR(WINED3DFMT_D15S1); 1192 FMT_TO_STR(WINED3DFMT_D24S8); 1193 FMT_TO_STR(WINED3DFMT_D24X8); 1194 FMT_TO_STR(WINED3DFMT_D24X4S4); 1195 FMT_TO_STR(WINED3DFMT_L16); 1196 FMT_TO_STR(WINED3DFMT_D32F_LOCKABLE); 1197 FMT_TO_STR(WINED3DFMT_D24FS8); 1203 FMT_TO_STR(WINED3DFMT_D32_UNORM); 1204 FMT_TO_STR(WINED3DFMT_S1_UINT_D15_UNORM); 1205 FMT_TO_STR(WINED3DFMT_S8_UINT_D24_UNORM); 1206 FMT_TO_STR(WINED3DFMT_X8D24_UNORM); 1207 FMT_TO_STR(WINED3DFMT_S4X4_UINT_D24_UNORM); 1208 FMT_TO_STR(WINED3DFMT_L16_UNORM); 1209 FMT_TO_STR(WINED3DFMT_S8_UINT_D24_FLOAT); 1198 1210 FMT_TO_STR(WINED3DFMT_VERTEXDATA); 1199 FMT_TO_STR(WINED3DFMT_ CxV8U8);1211 FMT_TO_STR(WINED3DFMT_R8G8_SNORM_Cx); 1200 1212 FMT_TO_STR(WINED3DFMT_ATI2N); 1201 1213 FMT_TO_STR(WINED3DFMT_NVHU); … … 1765 1777 switch(status) { 1766 1778 #define FBOSTATUS_TO_STR(u) case u: return #u 1767 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_COMPLETE _EXT);1768 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT _EXT);1769 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT _EXT);1779 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_COMPLETE); 1780 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT); 1781 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); 1770 1782 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT); 1771 1783 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT); 1772 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT); 1773 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT); 1774 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT); 1775 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED_EXT); 1784 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER); 1785 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER); 1786 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE); 1787 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED); 1788 FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNDEFINED); 1776 1789 #undef FBOSTATUS_TO_STR 1777 1790 default: … … 1791 1804 GLERROR_TO_STR(GL_STACK_UNDERFLOW); 1792 1805 GLERROR_TO_STR(GL_OUT_OF_MEMORY); 1793 GLERROR_TO_STR(GL_INVALID_FRAMEBUFFER_OPERATION _EXT);1806 GLERROR_TO_STR(GL_INVALID_FRAMEBUFFER_OPERATION); 1794 1807 #undef GLERROR_TO_STR 1795 1808 default: … … 2044 2057 switch(format_desc->format) 2045 2058 { 2046 case WINED3DFMT_ X8R8G8B8:2047 case WINED3DFMT_ R8G8B8:2048 case WINED3DFMT_ A8R8G8B8:2059 case WINED3DFMT_B8G8R8X8_UNORM: 2060 case WINED3DFMT_B8G8R8_UNORM: 2061 case WINED3DFMT_B8G8R8A8_UNORM: 2049 2062 case WINED3DFMT_R8G8B8A8_UNORM: 2050 case WINED3DFMT_ A2R10G10B10:2051 case WINED3DFMT_ X1R5G5B5:2052 case WINED3DFMT_ A1R5G5B5:2053 case WINED3DFMT_ R5G6B5:2054 case WINED3DFMT_ X4R4G4B4:2055 case WINED3DFMT_ A4R4G4B4:2056 case WINED3DFMT_ R3G3B2:2057 case WINED3DFMT_ A8P8:2058 case WINED3DFMT_P8 :2063 case WINED3DFMT_B10G10R10A2_UNORM: 2064 case WINED3DFMT_B5G5R5X1_UNORM: 2065 case WINED3DFMT_B5G5R5A1_UNORM: 2066 case WINED3DFMT_B5G6R5_UNORM: 2067 case WINED3DFMT_B4G4R4X4_UNORM: 2068 case WINED3DFMT_B4G4R4A4_UNORM: 2069 case WINED3DFMT_B2G3R3_UNORM: 2070 case WINED3DFMT_P8_UINT_A8_UNORM: 2071 case WINED3DFMT_P8_UINT: 2059 2072 break; 2060 2073 default: … … 2082 2095 case WINED3DFMT_D16_LOCKABLE: 2083 2096 case WINED3DFMT_D16_UNORM: 2084 case WINED3DFMT_ D15S1:2085 case WINED3DFMT_ D24X8:2086 case WINED3DFMT_ D24X4S4:2087 case WINED3DFMT_ D24S8:2088 case WINED3DFMT_ D24FS8:2089 case WINED3DFMT_D32 :2090 case WINED3DFMT_D32 F_LOCKABLE:2097 case WINED3DFMT_S1_UINT_D15_UNORM: 2098 case WINED3DFMT_X8D24_UNORM: 2099 case WINED3DFMT_S4X4_UINT_D24_UNORM: 2100 case WINED3DFMT_S8_UINT_D24_UNORM: 2101 case WINED3DFMT_S8_UINT_D24_FLOAT: 2102 case WINED3DFMT_D32_UNORM: 2103 case WINED3DFMT_D32_FLOAT: 2091 2104 break; 2092 2105 default: … … 2106 2119 WINED3DFORMAT pixelformat_for_depth(DWORD depth) { 2107 2120 switch(depth) { 2108 case 8: return WINED3DFMT_P8 ;2109 case 15: return WINED3DFMT_ X1R5G5B5;2110 case 16: return WINED3DFMT_ R5G6B5;2111 case 24: return WINED3DFMT_ X8R8G8B8; /* Robots needs 24bit to be X8R8G8B8*/2112 case 32: return WINED3DFMT_ X8R8G8B8; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return X8R8G8B8*/2121 case 8: return WINED3DFMT_P8_UINT; 2122 case 15: return WINED3DFMT_B5G5R5X1_UNORM; 2123 case 16: return WINED3DFMT_B5G6R5_UNORM; 2124 case 24: return WINED3DFMT_B8G8R8X8_UNORM; /* Robots needs 24bit to be WINED3DFMT_B8G8R8X8_UNORM */ 2125 case 32: return WINED3DFMT_B8G8R8X8_UNORM; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return WINED3DFMT_B8G8R8X8_UNORM */ 2113 2126 default: return WINED3DFMT_UNKNOWN; 2114 2127 } … … 2543 2556 settings->sRGB_write = 0; 2544 2557 } 2545 if(device->vs_clipping || !use_vs(stateblock)) { 2558 if(device->vs_clipping || !use_vs(stateblock) || !stateblock->renderState[WINED3DRS_CLIPPING] || 2559 !stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]) { 2546 2560 /* No need to emulate clipplanes if GL supports native vertex shader clipping or if 2547 * the fixed function vertex pipeline is used(which always supports clipplanes) 2561 * the fixed function vertex pipeline is used(which always supports clipplanes), or 2562 * if no clipplane is enabled 2548 2563 */ 2549 2564 settings->emul_clipplanes = 0; … … 2702 2717 UINT wined3d_log2i(UINT32 x) 2703 2718 { 2704 static const BYTEl[] =2705 { 2706 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,2707 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,2708 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,2709 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,2710 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,2711 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,2712 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,2713 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,2714 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2715 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2716 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2717 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2718 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2719 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2720 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2721 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,2719 static const UINT l[] = 2720 { 2721 ~0U, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2722 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2723 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2724 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2725 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2726 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2727 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2728 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2729 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2730 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2731 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2732 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2733 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2734 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2735 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2736 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2722 2737 }; 2723 2738 UINT32 i; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vertexdeclaration.c
r19678 r23571 6 6 * Copyright 2004 Christian Costa 7 7 * Copyright 2005 Oliver Stieber 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 84 85 85 86 HeapFree(GetProcessHeap(), 0, This->elements); 87 This->parent_ops->wined3d_object_destroyed(This->parent); 86 88 HeapFree(GetProcessHeap(), 0, This); 87 89 } … … 139 141 case WINED3DFMT_R32G32B32_FLOAT: 140 142 case WINED3DFMT_R32G32B32A32_FLOAT: 141 case WINED3DFMT_ A8R8G8B8:143 case WINED3DFMT_B8G8R8A8_UNORM: 142 144 case WINED3DFMT_R8G8B8A8_UINT: 143 145 case WINED3DFMT_R16G16_SINT: … … 183 185 case WINED3DFMT_R32G32B32_FLOAT: 184 186 case WINED3DFMT_R32G32B32A32_FLOAT: 185 case WINED3DFMT_ A8R8G8B8:187 case WINED3DFMT_B8G8R8A8_UNORM: 186 188 case WINED3DFMT_R8G8B8A8_UINT: 187 189 case WINED3DFMT_R16G16B16A16_SINT: … … 200 202 } 201 203 202 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This, 203 const WINED3DVERTEXELEMENT *elements, UINT element_count) 204 { 205 HRESULT hr = WINED3D_OK; 206 unsigned int i; 207 char isPreLoaded[MAX_STREAMS]; 208 209 TRACE("(%p) : d3d version %d\n", This, ((IWineD3DImpl *)This->wineD3DDevice->wineD3D)->dxVersion); 210 memset(isPreLoaded, 0, sizeof(isPreLoaded)); 211 212 if (TRACE_ON(d3d_decl)) { 213 for (i = 0; i < element_count; ++i) { 214 dump_wined3dvertexelement(elements+i); 215 } 216 } 217 218 This->element_count = element_count; 219 This->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->elements) * element_count); 220 if (!This->elements) 221 { 222 ERR("Memory allocation failed\n"); 223 return WINED3DERR_OUTOFVIDEOMEMORY; 224 } 225 226 /* Do some static analysis on the elements to make reading the declaration more comfortable 227 * for the drawing code 228 */ 229 This->num_streams = 0; 230 This->position_transformed = FALSE; 231 for (i = 0; i < element_count; ++i) { 232 struct wined3d_vertex_declaration_element *e = &This->elements[i]; 233 234 e->format_desc = getFormatDescEntry(elements[i].format, &This->wineD3DDevice->adapter->gl_info); 235 e->ffp_valid = declaration_element_valid_ffp(&elements[i]); 236 e->input_slot = elements[i].input_slot; 237 e->offset = elements[i].offset; 238 e->output_slot = elements[i].output_slot; 239 e->method = elements[i].method; 240 e->usage = elements[i].usage; 241 e->usage_idx = elements[i].usage_idx; 242 243 if (e->usage == WINED3DDECLUSAGE_POSITIONT) This->position_transformed = TRUE; 244 245 /* Find the Streams used in the declaration. The vertex buffers have to be loaded 246 * when drawing, but filter tesselation pseudo streams 247 */ 248 if (e->input_slot >= MAX_STREAMS) continue; 249 250 if (!e->format_desc->gl_vtx_format) 251 { 252 FIXME("The application tries to use an unsupported format (%s), returning E_FAIL\n", 253 debug_d3dformat(elements[i].format)); 254 /* The caller will release the vdecl, which will free This->elements */ 255 return E_FAIL; 256 } 257 258 if (e->offset & 0x3) 259 { 260 WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL\n", i, e->offset); 261 return E_FAIL; 262 } 263 264 if (!isPreLoaded[e->input_slot]) 265 { 266 This->streams[This->num_streams] = e->input_slot; 267 This->num_streams++; 268 isPreLoaded[e->input_slot] = 1; 269 } 270 271 if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT) 272 { 273 if (!GL_SUPPORT(ARB_HALF_FLOAT_VERTEX)) This->half_float_conv_needed = TRUE; 274 } 275 } 276 277 TRACE("Returning\n"); 278 return hr; 279 } 280 281 const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl = 204 static const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl = 282 205 { 283 206 /* IUnknown */ … … 289 212 IWineD3DVertexDeclarationImpl_GetDevice, 290 213 }; 214 215 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device, 216 const WINED3DVERTEXELEMENT *elements, UINT element_count, 217 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 218 { 219 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 220 WORD preloaded = 0; /* MAX_STREAMS, 16 */ 221 unsigned int i; 222 223 if (TRACE_ON(d3d_decl)) 224 { 225 for (i = 0; i < element_count; ++i) 226 { 227 dump_wined3dvertexelement(elements + i); 228 } 229 } 230 231 declaration->lpVtbl = &IWineD3DVertexDeclaration_Vtbl; 232 declaration->ref = 1; 233 declaration->parent = parent; 234 declaration->parent_ops = parent_ops; 235 declaration->wineD3DDevice = device; 236 declaration->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*declaration->elements) * element_count); 237 if (!declaration->elements) 238 { 239 ERR("Failed to allocate elements memory.\n"); 240 return E_OUTOFMEMORY; 241 } 242 declaration->element_count = element_count; 243 244 /* Do some static analysis on the elements to make reading the 245 * declaration more comfortable for the drawing code. */ 246 for (i = 0; i < element_count; ++i) 247 { 248 struct wined3d_vertex_declaration_element *e = &declaration->elements[i]; 249 250 e->format_desc = getFormatDescEntry(elements[i].format, gl_info); 251 e->ffp_valid = declaration_element_valid_ffp(&elements[i]); 252 e->input_slot = elements[i].input_slot; 253 e->offset = elements[i].offset; 254 e->output_slot = elements[i].output_slot; 255 e->method = elements[i].method; 256 e->usage = elements[i].usage; 257 e->usage_idx = elements[i].usage_idx; 258 259 if (e->usage == WINED3DDECLUSAGE_POSITIONT) declaration->position_transformed = TRUE; 260 261 /* Find the streams used in the declaration. The vertex buffers have 262 * to be loaded when drawing, but filter tesselation pseudo streams. */ 263 if (e->input_slot >= MAX_STREAMS) continue; 264 265 if (!e->format_desc->gl_vtx_format) 266 { 267 FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n", 268 debug_d3dformat(elements[i].format)); 269 HeapFree(GetProcessHeap(), 0, declaration->elements); 270 return E_FAIL; 271 } 272 273 if (e->offset & 0x3) 274 { 275 WARN("Declaration element %u is not 4 byte aligned(%u), returning E_FAIL.\n", i, e->offset); 276 HeapFree(GetProcessHeap(), 0, declaration->elements); 277 return E_FAIL; 278 } 279 280 if (!(preloaded & (1 << e->input_slot))) 281 { 282 declaration->streams[declaration->num_streams] = e->input_slot; 283 ++declaration->num_streams; 284 preloaded |= 1 << e->input_slot; 285 } 286 287 if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT) 288 { 289 if (!gl_info->supported[ARB_HALF_FLOAT_VERTEX]) declaration->half_float_conv_needed = TRUE; 290 } 291 } 292 293 return WINED3D_OK; 294 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vertexshader.c
r21731 r23571 8 8 * Copyright 2006 Ivan Gyurdiev 9 9 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 10 * Copyright 2009 Henri Verbeet for CodeWeavers 10 11 * 11 12 * This library is free software; you can redistribute it and/or … … 184 185 { 185 186 shader_cleanup((IWineD3DBaseShader *)iface); 187 This->baseShader.parent_ops->wined3d_object_destroyed(This->baseShader.parent); 186 188 HeapFree(GetProcessHeap(), 0, This); 187 189 } … … 196 198 static HRESULT WINAPI IWineD3DVertexShaderImpl_GetParent(IWineD3DVertexShader *iface, IUnknown** parent){ 197 199 IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; 198 199 *parent = This-> parent;200 201 *parent = This->baseShader.parent; 200 202 IUnknown_AddRef(*parent); 201 203 TRACE("(%p) : returning %p\n", This, *parent); … … 232 234 } 233 235 234 /* Note that for vertex shaders CompileShader isn't called until the 235 * shader is first used. The reason for this is that we need the vertex 236 * declaration the shader will be used with in order to determine if 237 * the data in a register is of type D3DCOLOR, and needs swizzling. */ 238 static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface, 239 const DWORD *pFunction, const struct wined3d_shader_signature *output_signature) 240 { 241 IWineD3DVertexShaderImpl *This =(IWineD3DVertexShaderImpl *)iface; 242 IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *) This->baseShader.device; 236 static HRESULT vertexshader_set_function(IWineD3DVertexShaderImpl *shader, 237 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature) 238 { 239 IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device; 240 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 243 241 const struct wined3d_shader_frontend *fe; 244 242 unsigned int i; 245 243 HRESULT hr; 246 shader_reg_maps *reg_maps = & This->baseShader.reg_maps;247 248 TRACE(" (%p) : pFunction %p\n", iface, pFunction);249 250 fe = shader_select_frontend(* pFunction);244 shader_reg_maps *reg_maps = &shader->baseShader.reg_maps; 245 246 TRACE("shader %p, byte_code %p, output_signature %p.\n", shader, byte_code, output_signature); 247 248 fe = shader_select_frontend(*byte_code); 251 249 if (!fe) 252 250 { … … 254 252 return WINED3DERR_INVALIDCALL; 255 253 } 256 This->baseShader.frontend = fe;257 This->baseShader.frontend_data = fe->shader_init(pFunction, output_signature);258 if (! This->baseShader.frontend_data)254 shader->baseShader.frontend = fe; 255 shader->baseShader.frontend_data = fe->shader_init(byte_code, output_signature); 256 if (!shader->baseShader.frontend_data) 259 257 { 260 258 FIXME("Failed to initialize frontend.\n"); … … 263 261 264 262 /* First pass: trace shader */ 265 if (TRACE_ON(d3d_shader)) shader_trace_init(fe, This->baseShader.frontend_data, pFunction);263 if (TRACE_ON(d3d_shader)) shader_trace_init(fe, shader->baseShader.frontend_data, byte_code); 266 264 267 265 /* Initialize immediate constant lists */ 268 list_init(& This->baseShader.constantsF);269 list_init(& This->baseShader.constantsB);270 list_init(& This->baseShader.constantsI);266 list_init(&shader->baseShader.constantsF); 267 list_init(&shader->baseShader.constantsB); 268 list_init(&shader->baseShader.constantsI); 271 269 272 270 /* Second pass: figure out registers used, semantics, etc.. */ 273 This->min_rel_offset = GL_LIMITS(vshader_constantsF);274 This->max_rel_offset = 0;275 hr = shader_get_registers_used((IWineD3DBaseShader *) This, fe,276 reg_maps, This->attributes, NULL, This->output_signature,277 pFunction, GL_LIMITS(vshader_constantsF));271 shader->min_rel_offset = gl_info->max_vshader_constantsF; 272 shader->max_rel_offset = 0; 273 hr = shader_get_registers_used((IWineD3DBaseShader *)shader, fe, 274 reg_maps, shader->attributes, NULL, shader->output_signature, 275 byte_code, gl_info->max_vshader_constantsF); 278 276 if (hr != WINED3D_OK) return hr; 279 277 … … 284 282 struct wined3d_shader_signature_element *e = &output_signature->elements[i]; 285 283 reg_maps->output_registers |= 1 << e->register_idx; 286 This->output_signature[e->register_idx] = *e; 287 } 288 } 289 290 vshader_set_limits(This); 291 292 if (deviceImpl->vs_selected_mode == SHADER_ARB 293 && ((GLINFO_LOCATION).quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT) 294 && This->min_rel_offset <= This->max_rel_offset) 295 { 296 if(This->max_rel_offset - This->min_rel_offset > 127) { 284 shader->output_signature[e->register_idx] = *e; 285 } 286 } 287 288 vshader_set_limits(shader); 289 290 if (device->vs_selected_mode == SHADER_ARB 291 && (gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT) 292 && shader->min_rel_offset <= shader->max_rel_offset) 293 { 294 if (shader->max_rel_offset - shader->min_rel_offset > 127) 295 { 297 296 FIXME("The difference between the minimum and maximum relative offset is > 127\n"); 298 297 FIXME("Which this OpenGL implementation does not support. Try using GLSL\n"); 299 FIXME("Min: %d, Max: %d\n", This->min_rel_offset, This->max_rel_offset); 300 } else if(This->max_rel_offset - This->min_rel_offset > 63) { 301 This->rel_offset = This->min_rel_offset + 63; 302 } else if(This->max_rel_offset > 63) { 303 This->rel_offset = This->min_rel_offset; 304 } else { 305 This->rel_offset = 0; 306 } 307 } 308 This->baseShader.load_local_constsF = This->baseShader.reg_maps.usesrelconstF && !list_empty(&This->baseShader.constantsF); 298 FIXME("Min: %d, Max: %d\n", shader->min_rel_offset, shader->max_rel_offset); 299 } 300 else if (shader->max_rel_offset - shader->min_rel_offset > 63) 301 { 302 shader->rel_offset = shader->min_rel_offset + 63; 303 } 304 else if (shader->max_rel_offset > 63) 305 { 306 shader->rel_offset = shader->min_rel_offset; 307 } 308 else 309 { 310 shader->rel_offset = 0; 311 } 312 } 313 shader->baseShader.load_local_constsF = shader->baseShader.reg_maps.usesrelconstF 314 && !list_empty(&shader->baseShader.constantsF); 309 315 310 316 /* copy the function ... because it will certainly be released by application */ 311 This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength);312 if (! This->baseShader.function) return E_OUTOFMEMORY;313 memcpy( This->baseShader.function, pFunction, This->baseShader.functionLength);317 shader->baseShader.function = HeapAlloc(GetProcessHeap(), 0, shader->baseShader.functionLength); 318 if (!shader->baseShader.function) return E_OUTOFMEMORY; 319 memcpy(shader->baseShader.function, byte_code, shader->baseShader.functionLength); 314 320 315 321 return WINED3D_OK; … … 342 348 } 343 349 344 const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =350 static const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl = 345 351 { 346 352 /*** IUnknown methods ***/ … … 351 357 IWineD3DVertexShaderImpl_GetParent, 352 358 /*** IWineD3DBaseShader methods ***/ 353 IWineD3DVertexShaderImpl_SetFunction,354 /*** IWineD3DVertexShader methods ***/355 359 IWineD3DVertexShaderImpl_GetDevice, 356 360 IWineD3DVertexShaderImpl_GetFunction, 361 /*** IWineD3DVertexShader methods ***/ 357 362 IWIneD3DVertexShaderImpl_SetLocalConstantsF 358 363 }; … … 362 367 args->swizzle_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.swizzle_map; 363 368 } 369 370 HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *device, 371 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, 372 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 373 { 374 HRESULT hr; 375 376 if (!byte_code) return WINED3DERR_INVALIDCALL; 377 378 shader->lpVtbl = &IWineD3DVertexShader_Vtbl; 379 shader_init(&shader->baseShader, device, parent, parent_ops); 380 381 hr = vertexshader_set_function(shader, byte_code, output_signature); 382 if (FAILED(hr)) 383 { 384 WARN("Failed to set function, hr %#x.\n", hr); 385 shader_cleanup((IWineD3DBaseShader *)shader); 386 return hr; 387 } 388 389 return WINED3D_OK; 390 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volume.c
r21731 r23571 5 5 * Copyright 2002-2005 Raphael Junqueira 6 6 * Copyright 2005 Oliver Stieber 7 * Copyright 2009 Henri Verbeet for CodeWeavers 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 40 41 IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; 41 42 IWineD3DVolumeTexture *texture; 42 intactive_sampler;43 DWORD active_sampler; 43 44 44 45 /* We don't need a specific texture unit, but after binding the texture the current unit is dirty. … … 63 64 } 64 65 65 if (active_sampler != -1) { 66 if (active_sampler != WINED3D_UNMAPPED_STAGE) 67 { 66 68 IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(active_sampler)); 67 69 } … … 131 133 if (ref == 0) { 132 134 resource_cleanup((IWineD3DResource *)iface); 135 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 133 136 HeapFree(GetProcessHeap(), 0, This); 134 137 } … … 273 276 if (containerType == WINED3DRTYPE_VOLUMETEXTURE) { 274 277 IWineD3DBaseTextureImpl* pTexture = (IWineD3DBaseTextureImpl*) cont; 275 pTexture->baseTexture.dirty = TRUE; 278 pTexture->baseTexture.texture_rgb.dirty = TRUE; 279 pTexture->baseTexture.texture_srgb.dirty = TRUE; 276 280 } else { 277 281 FIXME("Set dirty on container type %d\n", containerType); … … 355 359 } 356 360 357 const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =361 static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl = 358 362 { 359 363 /* IUnknown */ … … 381 385 IWineD3DVolumeImpl_SetContainer 382 386 }; 387 388 HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width, 389 UINT height, UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 390 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 391 { 392 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 393 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); 394 HRESULT hr; 395 396 if (!gl_info->supported[EXT_TEXTURE3D]) 397 { 398 WARN("Volume cannot be created - no volume texture support.\n"); 399 return WINED3DERR_INVALIDCALL; 400 } 401 402 volume->lpVtbl = &IWineD3DVolume_Vtbl; 403 404 hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device, 405 width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops); 406 if (FAILED(hr)) 407 { 408 WARN("Failed to initialize resource, returning %#x.\n", hr); 409 return hr; 410 } 411 412 volume->currentDesc.Width = width; 413 volume->currentDesc.Height = height; 414 volume->currentDesc.Depth = depth; 415 volume->lockable = TRUE; 416 volume->locked = FALSE; 417 memset(&volume->lockedBox, 0, sizeof(volume->lockedBox)); 418 volume->dirty = TRUE; 419 420 volume_add_dirty_box((IWineD3DVolume *)volume, NULL); 421 422 return WINED3D_OK; 423 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volumetexture.c
r22496 r23571 5 5 * Copyright 2002-2005 Raphael Junqueira 6 6 * Copyright 2005 Oliver Stieber 7 * Copyright 2009 Henri Verbeet for CodeWeavers 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 62 63 /* If the texture is marked dirty or the srgb sampler setting has changed 63 64 * since the last load then reload the volumes. */ 64 if (This->baseTexture. dirty)65 if (This->baseTexture.texture_rgb.dirty) 65 66 { 66 67 for (i = 0; i < This->baseTexture.levels; ++i) … … 83 84 84 85 /* No longer dirty */ 85 This->baseTexture. dirty = FALSE;86 } 87 88 static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This , D3DCB_DESTROYVOLUMEFN volume_destroy_cb)86 This->baseTexture.texture_rgb.dirty = FALSE; 87 } 88 89 static void volumetexture_cleanup(IWineD3DVolumeTextureImpl *This) 89 90 { 90 91 unsigned int i; … … 100 101 /* Cleanup the container. */ 101 102 IWineD3DVolume_SetContainer(volume, NULL); 102 volume_destroy_cb(volume);103 IWineD3DVolume_Release(volume); 103 104 } 104 105 } 105 106 basetexture_cleanup((IWineD3DBaseTexture *)This); 106 }107 108 HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, UINT depth, UINT levels,109 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent)110 {111 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;112 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);113 UINT tmp_w, tmp_h, tmp_d;114 unsigned int i;115 HRESULT hr;116 117 /* TODO: It should only be possible to create textures for formats118 * that are reported as supported. */119 if (WINED3DFMT_UNKNOWN >= format)120 {121 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);122 return WINED3DERR_INVALIDCALL;123 }124 125 if (!GL_SUPPORT(EXT_TEXTURE3D))126 {127 WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture);128 return WINED3DERR_INVALIDCALL;129 }130 131 /* Calculate levels for mip mapping. */132 if (usage & WINED3DUSAGE_AUTOGENMIPMAP)133 {134 if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP))135 {136 WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");137 return WINED3DERR_INVALIDCALL;138 }139 140 if (levels > 1)141 {142 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");143 return WINED3DERR_INVALIDCALL;144 }145 146 levels = 1;147 }148 else if (!levels)149 {150 levels = wined3d_log2i(max(max(width, height), depth)) + 1;151 TRACE("Calculated levels = %u.\n", levels);152 }153 154 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels,155 WINED3DRTYPE_VOLUMETEXTURE, device, 0, usage, format_desc, pool, parent);156 if (FAILED(hr))157 {158 WARN("Failed to initialize basetexture, returning %#x.\n", hr);159 return hr;160 }161 162 /* Is NP2 support for volumes needed? */163 texture->baseTexture.pow2Matrix[0] = 1.0f;164 texture->baseTexture.pow2Matrix[5] = 1.0f;165 texture->baseTexture.pow2Matrix[10] = 1.0f;166 texture->baseTexture.pow2Matrix[15] = 1.0f;167 168 /* Generate all the surfaces. */169 tmp_w = width;170 tmp_h = height;171 tmp_d = depth;172 173 for (i = 0; i < texture->baseTexture.levels; ++i)174 {175 /* Create the volume. */176 hr = IWineD3DDeviceParent_CreateVolume(device->device_parent, parent,177 tmp_w, tmp_h, tmp_d, format, pool, usage, &texture->volumes[i]);178 if (FAILED(hr))179 {180 ERR("Creating a volume for the volume texture failed, hr %#x.\n", hr);181 texture->volumes[i] = NULL;182 volumetexture_cleanup(texture, D3DCB_DefaultDestroyVolume);183 return hr;184 }185 186 /* Set its container to this texture. */187 IWineD3DVolume_SetContainer(texture->volumes[i], (IWineD3DBase *)texture);188 189 /* Calculate the next mipmap level. */190 tmp_w = max(1, tmp_w >> 1);191 tmp_h = max(1, tmp_h >> 1);192 tmp_d = max(1, tmp_d >> 1);193 }194 texture->baseTexture.internal_preload = volumetexture_internal_preload;195 196 return WINED3D_OK;197 107 } 198 108 … … 233 143 TRACE("(%p) : Releasing from %d\n", This, This->resource.ref); 234 144 ref = InterlockedDecrement(&This->resource.ref); 235 if (ref == 0) { 236 IWineD3DVolumeTexture_Destroy(iface, D3DCB_DefaultDestroyVolume); 145 if (!ref) 146 { 147 volumetexture_cleanup(This); 148 This->resource.parent_ops->wined3d_object_destroyed(This->resource.parent); 149 HeapFree(GetProcessHeap(), 0, This); 237 150 } 238 151 return ref; … … 354 267 IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow 355 268 ******************************************* */ 356 static void WINAPI IWineD3DVolumeTextureImpl_Destroy(IWineD3DVolumeTexture *iface, D3DCB_DESTROYVOLUMEFN D3DCB_DestroyVolume) {357 IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;358 359 volumetexture_cleanup(This, D3DCB_DestroyVolume);360 361 HeapFree(GetProcessHeap(), 0, This);362 }363 364 269 static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetLevelDesc(IWineD3DVolumeTexture *iface, UINT Level,WINED3DVOLUME_DESC *pDesc) { 365 270 IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; … … 417 322 static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, CONST WINED3DBOX* pDirtyBox) { 418 323 IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; 419 This->baseTexture.dirty = TRUE; 324 This->baseTexture.texture_rgb.dirty = TRUE; 325 This->baseTexture.texture_srgb.dirty = TRUE; 420 326 TRACE("(%p) : dirtyfication of volume Level (0)\n", This); 421 327 volume_add_dirty_box(This->volumes[0], pDirtyBox); … … 424 330 } 425 331 426 const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =332 static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl = 427 333 { 428 334 /* IUnknown */ … … 455 361 IWineD3DVolumeTextureImpl_IsCondNP2, 456 362 /* volume texture */ 457 IWineD3DVolumeTextureImpl_Destroy,458 363 IWineD3DVolumeTextureImpl_GetLevelDesc, 459 364 IWineD3DVolumeTextureImpl_GetVolumeLevel, … … 462 367 IWineD3DVolumeTextureImpl_AddDirtyBox 463 368 }; 369 370 HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, 371 UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 372 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 373 { 374 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; 375 const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info); 376 UINT tmp_w, tmp_h, tmp_d; 377 unsigned int i; 378 HRESULT hr; 379 380 /* TODO: It should only be possible to create textures for formats 381 * that are reported as supported. */ 382 if (WINED3DFMT_UNKNOWN >= format) 383 { 384 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); 385 return WINED3DERR_INVALIDCALL; 386 } 387 388 if (!gl_info->supported[EXT_TEXTURE3D]) 389 { 390 WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); 391 return WINED3DERR_INVALIDCALL; 392 } 393 394 /* Calculate levels for mip mapping. */ 395 if (usage & WINED3DUSAGE_AUTOGENMIPMAP) 396 { 397 if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) 398 { 399 WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); 400 return WINED3DERR_INVALIDCALL; 401 } 402 403 if (levels > 1) 404 { 405 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); 406 return WINED3DERR_INVALIDCALL; 407 } 408 409 levels = 1; 410 } 411 else if (!levels) 412 { 413 levels = wined3d_log2i(max(max(width, height), depth)) + 1; 414 TRACE("Calculated levels = %u.\n", levels); 415 } 416 417 texture->lpVtbl = &IWineD3DVolumeTexture_Vtbl; 418 419 hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, levels, WINED3DRTYPE_VOLUMETEXTURE, 420 device, 0, usage, format_desc, pool, parent, parent_ops); 421 if (FAILED(hr)) 422 { 423 WARN("Failed to initialize basetexture, returning %#x.\n", hr); 424 return hr; 425 } 426 427 /* Is NP2 support for volumes needed? */ 428 texture->baseTexture.pow2Matrix[0] = 1.0f; 429 texture->baseTexture.pow2Matrix[5] = 1.0f; 430 texture->baseTexture.pow2Matrix[10] = 1.0f; 431 texture->baseTexture.pow2Matrix[15] = 1.0f; 432 433 /* Generate all the surfaces. */ 434 tmp_w = width; 435 tmp_h = height; 436 tmp_d = depth; 437 438 for (i = 0; i < texture->baseTexture.levels; ++i) 439 { 440 /* Create the volume. */ 441 hr = IWineD3DDeviceParent_CreateVolume(device->device_parent, parent, 442 tmp_w, tmp_h, tmp_d, format, pool, usage, &texture->volumes[i]); 443 if (FAILED(hr)) 444 { 445 ERR("Creating a volume for the volume texture failed, hr %#x.\n", hr); 446 texture->volumes[i] = NULL; 447 volumetexture_cleanup(texture); 448 return hr; 449 } 450 451 /* Set its container to this texture. */ 452 IWineD3DVolume_SetContainer(texture->volumes[i], (IWineD3DBase *)texture); 453 454 /* Calculate the next mipmap level. */ 455 tmp_w = max(1, tmp_w >> 1); 456 tmp_h = max(1, tmp_h >> 1); 457 tmp_d = max(1, tmp_d >> 1); 458 } 459 texture->baseTexture.internal_preload = volumetexture_internal_preload; 460 461 return WINED3D_OK; 462 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d.def
r16410 r23571 4 4 5 5 EXPORTS 6 ; WineDirect3DCreate@8 @17 ; WineDirect3DCreateClipper@4 @28 ; WineDirect3DCreate@8 = WineDirect3DCreate9 ; WineDirect3DCreateClipper@4 = WineDirect3DCreateClipper10 6 WineDirect3DCreate 11 7 WineDirect3DCreateClipper 8 wined3d_mutex_lock 9 wined3d_mutex_unlock -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d.spec
r16410 r23571 1 1 @ stdcall WineDirect3DCreate(long ptr) 2 2 @ stdcall WineDirect3DCreateClipper(ptr) 3 @ stdcall wined3d_mutex_lock() 4 @ stdcall wined3d_mutex_unlock() -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h
r21731 r23571 812 812 #define GL_MULTISAMPLE_BIT 0x20000000 813 813 814 void (WINE_GLAPI *glAccum) (GLenum op, GLfloat value); 815 void (WINE_GLAPI *glAlphaFunc) (GLenum func, GLclampf ref); 816 GLboolean (WINE_GLAPI *glAreTexturesResident) (GLsizei n, const GLuint* textures, GLboolean* residences); 817 void (WINE_GLAPI *glArrayElement) (GLint i); 818 void (WINE_GLAPI *glBegin) (GLenum mode); 819 void (WINE_GLAPI *glBindTexture) (GLenum target, GLuint texture); 820 void (WINE_GLAPI *glBitmap) (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte* bitmap); 821 void (WINE_GLAPI *glBlendFunc) (GLenum sfactor, GLenum dfactor); 822 void (WINE_GLAPI *glCallList) (GLuint list); 823 void (WINE_GLAPI *glCallLists) (GLsizei n, GLenum type, const GLvoid* lists); 824 void (WINE_GLAPI *glClear) (GLbitfield mask); 825 void (WINE_GLAPI *glClearAccum) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 826 void (WINE_GLAPI *glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 827 void (WINE_GLAPI *glClearDepth) (GLclampd depth); 828 void (WINE_GLAPI *glClearIndex) (GLfloat c); 829 void (WINE_GLAPI *glClearStencil) (GLint s); 830 void (WINE_GLAPI *glClipPlane) (GLenum plane, const GLdouble* equation); 831 void (WINE_GLAPI *glColor3b) (GLbyte red, GLbyte green, GLbyte blue); 832 void (WINE_GLAPI *glColor3bv) (const GLbyte* v); 833 void (WINE_GLAPI *glColor3d) (GLdouble red, GLdouble green, GLdouble blue); 834 void (WINE_GLAPI *glColor3dv) (const GLdouble* v); 835 void (WINE_GLAPI *glColor3f) (GLfloat red, GLfloat green, GLfloat blue); 836 void (WINE_GLAPI *glColor3fv) (const GLfloat* v); 837 void (WINE_GLAPI *glColor3i) (GLint red, GLint green, GLint blue); 838 void (WINE_GLAPI *glColor3iv) (const GLint* v); 839 void (WINE_GLAPI *glColor3s) (GLshort red, GLshort green, GLshort blue); 840 void (WINE_GLAPI *glColor3sv) (const GLshort* v); 841 void (WINE_GLAPI *glColor3ub) (GLubyte red, GLubyte green, GLubyte blue); 842 void (WINE_GLAPI *glColor3ubv) (const GLubyte* v); 843 void (WINE_GLAPI *glColor3ui) (GLuint red, GLuint green, GLuint blue); 844 void (WINE_GLAPI *glColor3uiv) (const GLuint* v); 845 void (WINE_GLAPI *glColor3us) (GLushort red, GLushort green, GLushort blue); 846 void (WINE_GLAPI *glColor3usv) (const GLushort* v); 847 void (WINE_GLAPI *glColor4b) (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); 848 void (WINE_GLAPI *glColor4bv) (const GLbyte* v); 849 void (WINE_GLAPI *glColor4d) (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); 850 void (WINE_GLAPI *glColor4dv) (const GLdouble* v); 851 void (WINE_GLAPI *glColor4f) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 852 void (WINE_GLAPI *glColor4fv) (const GLfloat* v); 853 void (WINE_GLAPI *glColor4i) (GLint red, GLint green, GLint blue, GLint alpha); 854 void (WINE_GLAPI *glColor4iv) (const GLint* v); 855 void (WINE_GLAPI *glColor4s) (GLshort red, GLshort green, GLshort blue, GLshort alpha); 856 void (WINE_GLAPI *glColor4sv) (const GLshort* v); 857 void (WINE_GLAPI *glColor4ub) (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); 858 void (WINE_GLAPI *glColor4ubv) (const GLubyte* v); 859 void (WINE_GLAPI *glColor4ui) (GLuint red, GLuint green, GLuint blue, GLuint alpha); 860 void (WINE_GLAPI *glColor4uiv) (const GLuint* v); 861 void (WINE_GLAPI *glColor4us) (GLushort red, GLushort green, GLushort blue, GLushort alpha); 862 void (WINE_GLAPI *glColor4usv) (const GLushort* v); 863 void (WINE_GLAPI *glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 864 void (WINE_GLAPI *glColorMaterial) (GLenum face, GLenum mode); 865 void (WINE_GLAPI *glColorPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer); 866 void (WINE_GLAPI *glCopyPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); 867 void (WINE_GLAPI *glCopyTexImage1D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); 868 void (WINE_GLAPI *glCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); 869 void (WINE_GLAPI *glCopyTexSubImage1D) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); 870 void (WINE_GLAPI *glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); 871 void (WINE_GLAPI *glCullFace) (GLenum mode); 872 void (WINE_GLAPI *glDeleteLists) (GLuint list, GLsizei range); 873 void (WINE_GLAPI *glDeleteTextures) (GLsizei n, const GLuint* textures); 874 void (WINE_GLAPI *glDepthFunc) (GLenum func); 875 void (WINE_GLAPI *glDepthMask) (GLboolean flag); 876 void (WINE_GLAPI *glDepthRange) (GLclampd nearParam, GLclampd farParam); 877 void (WINE_GLAPI *glDisable) (GLenum cap); 878 void (WINE_GLAPI *glDisableWINE) (GLenum cap); 879 void (WINE_GLAPI *glDisableClientState) (GLenum array); 880 void (WINE_GLAPI *glDrawArrays) (GLenum mode, GLint first, GLsizei count); 881 void (WINE_GLAPI *glDrawBuffer) (GLenum mode); 882 void (WINE_GLAPI *glDrawElements) (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); 883 void (WINE_GLAPI *glDrawPixels) (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); 884 void (WINE_GLAPI *glEdgeFlag) (GLboolean flag); 885 void (WINE_GLAPI *glEdgeFlagPointer) (GLsizei stride, const GLvoid* pointer); 886 void (WINE_GLAPI *glEdgeFlagv) (const GLboolean* flag); 887 void (WINE_GLAPI *glEnable) (GLenum cap); 888 void (WINE_GLAPI *glEnableWINE) (GLenum cap); 889 void (WINE_GLAPI *glEnableClientState) (GLenum array); 890 void (WINE_GLAPI *glEnd) (); 891 void (WINE_GLAPI *glEndList) (); 892 void (WINE_GLAPI *glEvalCoord1d) (GLdouble u); 893 void (WINE_GLAPI *glEvalCoord1dv) (const GLdouble* u); 894 void (WINE_GLAPI *glEvalCoord1f) (GLfloat u); 895 void (WINE_GLAPI *glEvalCoord1fv) (const GLfloat* u); 896 void (WINE_GLAPI *glEvalCoord2d) (GLdouble u, GLdouble v); 897 void (WINE_GLAPI *glEvalCoord2dv) (const GLdouble* u); 898 void (WINE_GLAPI *glEvalCoord2f) (GLfloat u, GLfloat v); 899 void (WINE_GLAPI *glEvalCoord2fv) (const GLfloat* u); 900 void (WINE_GLAPI *glEvalMesh1) (GLenum mode, GLint i1, GLint i2); 901 void (WINE_GLAPI *glEvalMesh2) (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); 902 void (WINE_GLAPI *glEvalPoint1) (GLint i); 903 void (WINE_GLAPI *glEvalPoint2) (GLint i, GLint j); 904 void (WINE_GLAPI *glFeedbackBuffer) (GLsizei size, GLenum type, GLfloat* buffer); 905 void (WINE_GLAPI *glFogf) (GLenum pname, GLfloat param); 906 void (WINE_GLAPI *glFogfv) (GLenum pname, const GLfloat* params); 907 void (WINE_GLAPI *glFogi) (GLenum pname, GLint param); 908 void (WINE_GLAPI *glFogiv) (GLenum pname, const GLint* params); 909 void (WINE_GLAPI *glFrontFace) (GLenum mode); 910 void (WINE_GLAPI *glFrustum) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); 911 GLuint (WINE_GLAPI *glGenLists) (GLsizei range); 912 void (WINE_GLAPI *glGenTextures) (GLsizei n, GLuint* textures); 913 void (WINE_GLAPI *glGetBooleanv) (GLenum pname, GLboolean* params); 914 void (WINE_GLAPI *glGetClipPlane) (GLenum plane, GLdouble* equation); 915 void (WINE_GLAPI *glGetDoublev) (GLenum pname, GLdouble* params); 916 GLenum (WINE_GLAPI *glGetError) (); 917 void (WINE_GLAPI *glGetFloatv) (GLenum pname, GLfloat* params); 918 void (WINE_GLAPI *glGetIntegerv) (GLenum pname, GLint* params); 919 void (WINE_GLAPI *glGetLightfv) (GLenum light, GLenum pname, GLfloat* params); 920 void (WINE_GLAPI *glGetLightiv) (GLenum light, GLenum pname, GLint* params); 921 void (WINE_GLAPI *glGetMapdv) (GLenum target, GLenum query, GLdouble* v); 922 void (WINE_GLAPI *glGetMapfv) (GLenum target, GLenum query, GLfloat* v); 923 void (WINE_GLAPI *glGetMapiv) (GLenum target, GLenum query, GLint* v); 924 void (WINE_GLAPI *glGetMaterialfv) (GLenum face, GLenum pname, GLfloat* params); 925 void (WINE_GLAPI *glGetMaterialiv) (GLenum face, GLenum pname, GLint* params); 926 void (WINE_GLAPI *glGetPixelMapfv) (GLenum map, GLfloat* values); 927 void (WINE_GLAPI *glGetPixelMapuiv) (GLenum map, GLuint* values); 928 void (WINE_GLAPI *glGetPixelMapusv) (GLenum map, GLushort* values); 929 void (WINE_GLAPI *glGetPointerv) (GLenum pname, GLvoid** params); 930 void (WINE_GLAPI *glGetPolygonStipple) (GLubyte* mask); 931 const GLubyte * (WINE_GLAPI *glGetString) (GLenum name); 932 void (WINE_GLAPI *glGetTexEnvfv) (GLenum target, GLenum pname, GLfloat* params); 933 void (WINE_GLAPI *glGetTexEnviv) (GLenum target, GLenum pname, GLint* params); 934 void (WINE_GLAPI *glGetTexGendv) (GLenum coord, GLenum pname, GLdouble* params); 935 void (WINE_GLAPI *glGetTexGenfv) (GLenum coord, GLenum pname, GLfloat* params); 936 void (WINE_GLAPI *glGetTexGeniv) (GLenum coord, GLenum pname, GLint* params); 937 void (WINE_GLAPI *glGetTexImage) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid* pixels); 938 void (WINE_GLAPI *glGetTexLevelParameterfv) (GLenum target, GLint level, GLenum pname, GLfloat* params); 939 void (WINE_GLAPI *glGetTexLevelParameteriv) (GLenum target, GLint level, GLenum pname, GLint* params); 940 void (WINE_GLAPI *glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat* params); 941 void (WINE_GLAPI *glGetTexParameteriv) (GLenum target, GLenum pname, GLint* params); 942 void (WINE_GLAPI *glHint) (GLenum target, GLenum mode); 943 void (WINE_GLAPI *glIndexMask) (GLuint mask); 944 void (WINE_GLAPI *glIndexPointer) (GLenum type, GLsizei stride, const GLvoid* pointer); 945 void (WINE_GLAPI *glIndexd) (GLdouble c); 946 void (WINE_GLAPI *glIndexdv) (const GLdouble* c); 947 void (WINE_GLAPI *glIndexf) (GLfloat c); 948 void (WINE_GLAPI *glIndexfv) (const GLfloat* c); 949 void (WINE_GLAPI *glIndexi) (GLint c); 950 void (WINE_GLAPI *glIndexiv) (const GLint* c); 951 void (WINE_GLAPI *glIndexs) (GLshort c); 952 void (WINE_GLAPI *glIndexsv) (const GLshort* c); 953 void (WINE_GLAPI *glIndexub) (GLubyte c); 954 void (WINE_GLAPI *glIndexubv) (const GLubyte* c); 955 void (WINE_GLAPI *glInitNames) (); 956 void (WINE_GLAPI *glInterleavedArrays) (GLenum format, GLsizei stride, const GLvoid* pointer); 957 GLboolean (WINE_GLAPI *glIsEnabled) (GLenum cap); 958 GLboolean (WINE_GLAPI *glIsList) (GLuint list); 959 GLboolean (WINE_GLAPI *glIsTexture) (GLuint texture); 960 void (WINE_GLAPI *glLightModelf) (GLenum pname, GLfloat param); 961 void (WINE_GLAPI *glLightModelfv) (GLenum pname, const GLfloat* params); 962 void (WINE_GLAPI *glLightModeli) (GLenum pname, GLint param); 963 void (WINE_GLAPI *glLightModeliv) (GLenum pname, const GLint* params); 964 void (WINE_GLAPI *glLightf) (GLenum light, GLenum pname, GLfloat param); 965 void (WINE_GLAPI *glLightfv) (GLenum light, GLenum pname, const GLfloat* params); 966 void (WINE_GLAPI *glLighti) (GLenum light, GLenum pname, GLint param); 967 void (WINE_GLAPI *glLightiv) (GLenum light, GLenum pname, const GLint* params); 968 void (WINE_GLAPI *glLineStipple) (GLint factor, GLushort pattern); 969 void (WINE_GLAPI *glLineWidth) (GLfloat width); 970 void (WINE_GLAPI *glListBase) (GLuint base); 971 void (WINE_GLAPI *glLoadIdentity) (); 972 void (WINE_GLAPI *glLoadMatrixd) (const GLdouble* m); 973 void (WINE_GLAPI *glLoadMatrixf) (const GLfloat* m); 974 void (WINE_GLAPI *glLoadName) (GLuint name); 975 void (WINE_GLAPI *glLogicOp) (GLenum opcode); 976 void (WINE_GLAPI *glMap1d) (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); 977 void (WINE_GLAPI *glMap1f) (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); 978 void (WINE_GLAPI *glMap2d) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); 979 void (WINE_GLAPI *glMap2f) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); 980 void (WINE_GLAPI *glMapGrid1d) (GLint un, GLdouble u1, GLdouble u2); 981 void (WINE_GLAPI *glMapGrid1f) (GLint un, GLfloat u1, GLfloat u2); 982 void (WINE_GLAPI *glMapGrid2d) (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); 983 void (WINE_GLAPI *glMapGrid2f) (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); 984 void (WINE_GLAPI *glMaterialf) (GLenum face, GLenum pname, GLfloat param); 985 void (WINE_GLAPI *glMaterialfv) (GLenum face, GLenum pname, const GLfloat* params); 986 void (WINE_GLAPI *glMateriali) (GLenum face, GLenum pname, GLint param); 987 void (WINE_GLAPI *glMaterialiv) (GLenum face, GLenum pname, const GLint* params); 988 void (WINE_GLAPI *glMatrixMode) (GLenum mode); 989 void (WINE_GLAPI *glMultMatrixd) (const GLdouble* m); 990 void (WINE_GLAPI *glMultMatrixf) (const GLfloat* m); 991 void (WINE_GLAPI *glNewList) (GLuint list, GLenum mode); 992 void (WINE_GLAPI *glNormal3b) (GLbyte nx, GLbyte ny, GLbyte nz); 993 void (WINE_GLAPI *glNormal3bv) (const GLbyte* v); 994 void (WINE_GLAPI *glNormal3d) (GLdouble nx, GLdouble ny, GLdouble nz); 995 void (WINE_GLAPI *glNormal3dv) (const GLdouble* v); 996 void (WINE_GLAPI *glNormal3f) (GLfloat nx, GLfloat ny, GLfloat nz); 997 void (WINE_GLAPI *glNormal3fv) (const GLfloat* v); 998 void (WINE_GLAPI *glNormal3i) (GLint nx, GLint ny, GLint nz); 999 void (WINE_GLAPI *glNormal3iv) (const GLint* v); 1000 void (WINE_GLAPI *glNormal3s) (GLshort nx, GLshort ny, GLshort nz); 1001 void (WINE_GLAPI *glNormal3sv) (const GLshort* v); 1002 void (WINE_GLAPI *glNormalPointer) (GLenum type, GLsizei stride, const GLvoid* pointer); 1003 void (WINE_GLAPI *glOrtho) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); 1004 void (WINE_GLAPI *glPassThrough) (GLfloat token); 1005 void (WINE_GLAPI *glPixelMapfv) (GLenum map, GLint mapsize, const GLfloat* values); 1006 void (WINE_GLAPI *glPixelMapuiv) (GLenum map, GLint mapsize, const GLuint* values); 1007 void (WINE_GLAPI *glPixelMapusv) (GLenum map, GLint mapsize, const GLushort* values); 1008 void (WINE_GLAPI *glPixelStoref) (GLenum pname, GLfloat param); 1009 void (WINE_GLAPI *glPixelStorei) (GLenum pname, GLint param); 1010 void (WINE_GLAPI *glPixelTransferf) (GLenum pname, GLfloat param); 1011 void (WINE_GLAPI *glPixelTransferi) (GLenum pname, GLint param); 1012 void (WINE_GLAPI *glPixelZoom) (GLfloat xfactor, GLfloat yfactor); 1013 void (WINE_GLAPI *glPointSize) (GLfloat size); 1014 void (WINE_GLAPI *glPolygonMode) (GLenum face, GLenum mode); 1015 void (WINE_GLAPI *glPolygonOffset) (GLfloat factor, GLfloat units); 1016 void (WINE_GLAPI *glPolygonStipple) (const GLubyte* mask); 1017 void (WINE_GLAPI *glPopAttrib) (); 1018 void (WINE_GLAPI *glPopClientAttrib) (); 1019 void (WINE_GLAPI *glPopMatrix) (); 1020 void (WINE_GLAPI *glPopName) (); 1021 void (WINE_GLAPI *glPrioritizeTextures) (GLsizei n, const GLuint* textures, const GLclampf* priorities); 1022 void (WINE_GLAPI *glPushAttrib) (GLbitfield mask); 1023 void (WINE_GLAPI *glPushClientAttrib) (GLbitfield mask); 1024 void (WINE_GLAPI *glPushMatrix) (); 1025 void (WINE_GLAPI *glPushName) (GLuint name); 1026 void (WINE_GLAPI *glRasterPos2d) (GLdouble x, GLdouble y); 1027 void (WINE_GLAPI *glRasterPos2dv) (const GLdouble* v); 1028 void (WINE_GLAPI *glRasterPos2f) (GLfloat x, GLfloat y); 1029 void (WINE_GLAPI *glRasterPos2fv) (const GLfloat* v); 1030 void (WINE_GLAPI *glRasterPos2i) (GLint x, GLint y); 1031 void (WINE_GLAPI *glRasterPos2iv) (const GLint* v); 1032 void (WINE_GLAPI *glRasterPos2s) (GLshort x, GLshort y); 1033 void (WINE_GLAPI *glRasterPos2sv) (const GLshort* v); 1034 void (WINE_GLAPI *glRasterPos3d) (GLdouble x, GLdouble y, GLdouble z); 1035 void (WINE_GLAPI *glRasterPos3dv) (const GLdouble* v); 1036 void (WINE_GLAPI *glRasterPos3f) (GLfloat x, GLfloat y, GLfloat z); 1037 void (WINE_GLAPI *glRasterPos3fv) (const GLfloat* v); 1038 void (WINE_GLAPI *glRasterPos3i) (GLint x, GLint y, GLint z); 1039 void (WINE_GLAPI *glRasterPos3iv) (const GLint* v); 1040 void (WINE_GLAPI *glRasterPos3s) (GLshort x, GLshort y, GLshort z); 1041 void (WINE_GLAPI *glRasterPos3sv) (const GLshort* v); 1042 void (WINE_GLAPI *glRasterPos4d) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); 1043 void (WINE_GLAPI *glRasterPos4dv) (const GLdouble* v); 1044 void (WINE_GLAPI *glRasterPos4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); 1045 void (WINE_GLAPI *glRasterPos4fv) (const GLfloat* v); 1046 void (WINE_GLAPI *glRasterPos4i) (GLint x, GLint y, GLint z, GLint w); 1047 void (WINE_GLAPI *glRasterPos4iv) (const GLint* v); 1048 void (WINE_GLAPI *glRasterPos4s) (GLshort x, GLshort y, GLshort z, GLshort w); 1049 void (WINE_GLAPI *glRasterPos4sv) (const GLshort* v); 1050 void (WINE_GLAPI *glReadBuffer) (GLenum mode); 1051 void (WINE_GLAPI *glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); 1052 void (WINE_GLAPI *glRectd) (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); 1053 void (WINE_GLAPI *glRectdv) (const GLdouble* v1, const GLdouble* v2); 1054 void (WINE_GLAPI *glRectf) (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); 1055 void (WINE_GLAPI *glRectfv) (const GLfloat* v1, const GLfloat* v2); 1056 void (WINE_GLAPI *glRecti) (GLint x1, GLint y1, GLint x2, GLint y2); 1057 void (WINE_GLAPI *glRectiv) (const GLint* v1, const GLint* v2); 1058 void (WINE_GLAPI *glRects) (GLshort x1, GLshort y1, GLshort x2, GLshort y2); 1059 void (WINE_GLAPI *glRectsv) (const GLshort* v1, const GLshort* v2); 1060 GLint (WINE_GLAPI *glRenderMode) (GLenum mode); 1061 void (WINE_GLAPI *glRotated) (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); 1062 void (WINE_GLAPI *glRotatef) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); 1063 void (WINE_GLAPI *glScaled) (GLdouble x, GLdouble y, GLdouble z); 1064 void (WINE_GLAPI *glScalef) (GLfloat x, GLfloat y, GLfloat z); 1065 void (WINE_GLAPI *glScissor) (GLint x, GLint y, GLsizei width, GLsizei height); 1066 void (WINE_GLAPI *glSelectBuffer) (GLsizei size, GLuint* buffer); 1067 void (WINE_GLAPI *glShadeModel) (GLenum mode); 1068 void (WINE_GLAPI *glStencilFunc) (GLenum func, GLint ref, GLuint mask); 1069 void (WINE_GLAPI *glStencilMask) (GLuint mask); 1070 void (WINE_GLAPI *glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass); 1071 void (WINE_GLAPI *glTexCoord1d) (GLdouble s); 1072 void (WINE_GLAPI *glTexCoord1dv) (const GLdouble* v); 1073 void (WINE_GLAPI *glTexCoord1f) (GLfloat s); 1074 void (WINE_GLAPI *glTexCoord1fv) (const GLfloat* v); 1075 void (WINE_GLAPI *glTexCoord1i) (GLint s); 1076 void (WINE_GLAPI *glTexCoord1iv) (const GLint* v); 1077 void (WINE_GLAPI *glTexCoord1s) (GLshort s); 1078 void (WINE_GLAPI *glTexCoord1sv) (const GLshort* v); 1079 void (WINE_GLAPI *glTexCoord2d) (GLdouble s, GLdouble t); 1080 void (WINE_GLAPI *glTexCoord2dv) (const GLdouble* v); 1081 void (WINE_GLAPI *glTexCoord2f) (GLfloat s, GLfloat t); 1082 void (WINE_GLAPI *glTexCoord2fv) (const GLfloat* v); 1083 void (WINE_GLAPI *glTexCoord2i) (GLint s, GLint t); 1084 void (WINE_GLAPI *glTexCoord2iv) (const GLint* v); 1085 void (WINE_GLAPI *glTexCoord2s) (GLshort s, GLshort t); 1086 void (WINE_GLAPI *glTexCoord2sv) (const GLshort* v); 1087 void (WINE_GLAPI *glTexCoord3d) (GLdouble s, GLdouble t, GLdouble r); 1088 void (WINE_GLAPI *glTexCoord3dv) (const GLdouble* v); 1089 void (WINE_GLAPI *glTexCoord3f) (GLfloat s, GLfloat t, GLfloat r); 1090 void (WINE_GLAPI *glTexCoord3fv) (const GLfloat* v); 1091 void (WINE_GLAPI *glTexCoord3i) (GLint s, GLint t, GLint r); 1092 void (WINE_GLAPI *glTexCoord3iv) (const GLint* v); 1093 void (WINE_GLAPI *glTexCoord3s) (GLshort s, GLshort t, GLshort r); 1094 void (WINE_GLAPI *glTexCoord3sv) (const GLshort* v); 1095 void (WINE_GLAPI *glTexCoord4d) (GLdouble s, GLdouble t, GLdouble r, GLdouble q); 1096 void (WINE_GLAPI *glTexCoord4dv) (const GLdouble* v); 1097 void (WINE_GLAPI *glTexCoord4f) (GLfloat s, GLfloat t, GLfloat r, GLfloat q); 1098 void (WINE_GLAPI *glTexCoord4fv) (const GLfloat* v); 1099 void (WINE_GLAPI *glTexCoord4i) (GLint s, GLint t, GLint r, GLint q); 1100 void (WINE_GLAPI *glTexCoord4iv) (const GLint* v); 1101 void (WINE_GLAPI *glTexCoord4s) (GLshort s, GLshort t, GLshort r, GLshort q); 1102 void (WINE_GLAPI *glTexCoord4sv) (const GLshort* v); 1103 void (WINE_GLAPI *glTexCoordPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer); 1104 void (WINE_GLAPI *glTexEnvf) (GLenum target, GLenum pname, GLfloat param); 1105 void (WINE_GLAPI *glTexEnvfv) (GLenum target, GLenum pname, const GLfloat* params); 1106 void (WINE_GLAPI *glTexEnvi) (GLenum target, GLenum pname, GLint param); 1107 void (WINE_GLAPI *glTexEnviv) (GLenum target, GLenum pname, const GLint* params); 1108 void (WINE_GLAPI *glTexGend) (GLenum coord, GLenum pname, GLdouble param); 1109 void (WINE_GLAPI *glTexGendv) (GLenum coord, GLenum pname, const GLdouble* params); 1110 void (WINE_GLAPI *glTexGenf) (GLenum coord, GLenum pname, GLfloat param); 1111 void (WINE_GLAPI *glTexGenfv) (GLenum coord, GLenum pname, const GLfloat* params); 1112 void (WINE_GLAPI *glTexGeni) (GLenum coord, GLenum pname, GLint param); 1113 void (WINE_GLAPI *glTexGeniv) (GLenum coord, GLenum pname, const GLint* params); 1114 void (WINE_GLAPI *glTexImage1D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 1115 void (WINE_GLAPI *glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 1116 void (WINE_GLAPI *glTexParameterf) (GLenum target, GLenum pname, GLfloat param); 1117 void (WINE_GLAPI *glTexParameterfv) (GLenum target, GLenum pname, const GLfloat* params); 1118 void (WINE_GLAPI *glTexParameteri) (GLenum target, GLenum pname, GLint param); 1119 void (WINE_GLAPI *glTexParameteriv) (GLenum target, GLenum pname, const GLint* params); 1120 void (WINE_GLAPI *glTexSubImage1D) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid* pixels); 1121 void (WINE_GLAPI *glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); 1122 void (WINE_GLAPI *glTranslated) (GLdouble x, GLdouble y, GLdouble z); 1123 void (WINE_GLAPI *glTranslatef) (GLfloat x, GLfloat y, GLfloat z); 1124 void (WINE_GLAPI *glVertex2d) (GLdouble x, GLdouble y); 1125 void (WINE_GLAPI *glVertex2dv) (const GLdouble* v); 1126 void (WINE_GLAPI *glVertex2f) (GLfloat x, GLfloat y); 1127 void (WINE_GLAPI *glVertex2fv) (const GLfloat* v); 1128 void (WINE_GLAPI *glVertex2i) (GLint x, GLint y); 1129 void (WINE_GLAPI *glVertex2iv) (const GLint* v); 1130 void (WINE_GLAPI *glVertex2s) (GLshort x, GLshort y); 1131 void (WINE_GLAPI *glVertex2sv) (const GLshort* v); 1132 void (WINE_GLAPI *glVertex3d) (GLdouble x, GLdouble y, GLdouble z); 1133 void (WINE_GLAPI *glVertex3dv) (const GLdouble* v); 1134 void (WINE_GLAPI *glVertex3f) (GLfloat x, GLfloat y, GLfloat z); 1135 void (WINE_GLAPI *glVertex3fv) (const GLfloat* v); 1136 void (WINE_GLAPI *glVertex3i) (GLint x, GLint y, GLint z); 1137 void (WINE_GLAPI *glVertex3iv) (const GLint* v); 1138 void (WINE_GLAPI *glVertex3s) (GLshort x, GLshort y, GLshort z); 1139 void (WINE_GLAPI *glVertex3sv) (const GLshort* v); 1140 void (WINE_GLAPI *glVertex4d) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); 1141 void (WINE_GLAPI *glVertex4dv) (const GLdouble* v); 1142 void (WINE_GLAPI *glVertex4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); 1143 void (WINE_GLAPI *glVertex4fv) (const GLfloat* v); 1144 void (WINE_GLAPI *glVertex4i) (GLint x, GLint y, GLint z, GLint w); 1145 void (WINE_GLAPI *glVertex4iv) (const GLint* v); 1146 void (WINE_GLAPI *glVertex4s) (GLshort x, GLshort y, GLshort z, GLshort w); 1147 void (WINE_GLAPI *glVertex4sv) (const GLshort* v); 1148 void (WINE_GLAPI *glVertexPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer); 1149 void (WINE_GLAPI *glViewport) (GLint x, GLint y, GLsizei width, GLsizei height); 1150 void (WINE_GLAPI *glPointParameterfv) (GLenum pname, const GLfloat *params); 814 void (WINE_GLAPI *glAccum)(GLenum op, GLfloat value) DECLSPEC_HIDDEN; 815 void (WINE_GLAPI *glAlphaFunc)(GLenum func, GLclampf ref) DECLSPEC_HIDDEN; 816 GLboolean (WINE_GLAPI *glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences) DECLSPEC_HIDDEN; 817 void (WINE_GLAPI *glArrayElement)(GLint i) DECLSPEC_HIDDEN; 818 void (WINE_GLAPI *glBegin)(GLenum mode) DECLSPEC_HIDDEN; 819 void (WINE_GLAPI *glBindTexture)(GLenum target, GLuint texture) DECLSPEC_HIDDEN; 820 void (WINE_GLAPI *glBitmap)(GLsizei width, GLsizei height, GLfloat xorig, 821 GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) DECLSPEC_HIDDEN; 822 void (WINE_GLAPI *glBlendFunc)(GLenum sfactor, GLenum dfactor) DECLSPEC_HIDDEN; 823 void (WINE_GLAPI *glCallList)(GLuint list) DECLSPEC_HIDDEN; 824 void (WINE_GLAPI *glCallLists)(GLsizei n, GLenum type, const GLvoid *lists) DECLSPEC_HIDDEN; 825 void (WINE_GLAPI *glClear)(GLbitfield mask) DECLSPEC_HIDDEN; 826 void (WINE_GLAPI *glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) DECLSPEC_HIDDEN; 827 void (WINE_GLAPI *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) DECLSPEC_HIDDEN; 828 void (WINE_GLAPI *glClearDepth)(GLclampd depth) DECLSPEC_HIDDEN; 829 void (WINE_GLAPI *glClearIndex)(GLfloat c) DECLSPEC_HIDDEN; 830 void (WINE_GLAPI *glClearStencil)(GLint s) DECLSPEC_HIDDEN; 831 void (WINE_GLAPI *glClipPlane)(GLenum plane, const GLdouble *equation) DECLSPEC_HIDDEN; 832 void (WINE_GLAPI *glColor3b)(GLbyte red, GLbyte green, GLbyte blue) DECLSPEC_HIDDEN; 833 void (WINE_GLAPI *glColor3bv)(const GLbyte *v) DECLSPEC_HIDDEN; 834 void (WINE_GLAPI *glColor3d)(GLdouble red, GLdouble green, GLdouble blue) DECLSPEC_HIDDEN; 835 void (WINE_GLAPI *glColor3dv)(const GLdouble *v) DECLSPEC_HIDDEN; 836 void (WINE_GLAPI *glColor3f)(GLfloat red, GLfloat green, GLfloat blue) DECLSPEC_HIDDEN; 837 void (WINE_GLAPI *glColor3fv)(const GLfloat *v) DECLSPEC_HIDDEN; 838 void (WINE_GLAPI *glColor3i)(GLint red, GLint green, GLint blue) DECLSPEC_HIDDEN; 839 void (WINE_GLAPI *glColor3iv)(const GLint *v) DECLSPEC_HIDDEN; 840 void (WINE_GLAPI *glColor3s)(GLshort red, GLshort green, GLshort blue) DECLSPEC_HIDDEN; 841 void (WINE_GLAPI *glColor3sv)(const GLshort *v) DECLSPEC_HIDDEN; 842 void (WINE_GLAPI *glColor3ub)(GLubyte red, GLubyte green, GLubyte blue) DECLSPEC_HIDDEN; 843 void (WINE_GLAPI *glColor3ubv)(const GLubyte *v) DECLSPEC_HIDDEN; 844 void (WINE_GLAPI *glColor3ui)(GLuint red, GLuint green, GLuint blue) DECLSPEC_HIDDEN; 845 void (WINE_GLAPI *glColor3uiv)(const GLuint *v) DECLSPEC_HIDDEN; 846 void (WINE_GLAPI *glColor3us)(GLushort red, GLushort green, GLushort blue) DECLSPEC_HIDDEN; 847 void (WINE_GLAPI *glColor3usv)(const GLushort *v) DECLSPEC_HIDDEN; 848 void (WINE_GLAPI *glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) DECLSPEC_HIDDEN; 849 void (WINE_GLAPI *glColor4bv)(const GLbyte *v) DECLSPEC_HIDDEN; 850 void (WINE_GLAPI *glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) DECLSPEC_HIDDEN; 851 void (WINE_GLAPI *glColor4dv)(const GLdouble *v) DECLSPEC_HIDDEN; 852 void (WINE_GLAPI *glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) DECLSPEC_HIDDEN; 853 void (WINE_GLAPI *glColor4fv)(const GLfloat *v) DECLSPEC_HIDDEN; 854 void (WINE_GLAPI *glColor4i)(GLint red, GLint green, GLint blue, GLint alpha) DECLSPEC_HIDDEN; 855 void (WINE_GLAPI *glColor4iv)(const GLint *v) DECLSPEC_HIDDEN; 856 void (WINE_GLAPI *glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha) DECLSPEC_HIDDEN; 857 void (WINE_GLAPI *glColor4sv)(const GLshort *v) DECLSPEC_HIDDEN; 858 void (WINE_GLAPI *glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) DECLSPEC_HIDDEN; 859 void (WINE_GLAPI *glColor4ubv)(const GLubyte *v) DECLSPEC_HIDDEN; 860 void (WINE_GLAPI *glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha) DECLSPEC_HIDDEN; 861 void (WINE_GLAPI *glColor4uiv)(const GLuint *v) DECLSPEC_HIDDEN; 862 void (WINE_GLAPI *glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha) DECLSPEC_HIDDEN; 863 void (WINE_GLAPI *glColor4usv)(const GLushort *v) DECLSPEC_HIDDEN; 864 void (WINE_GLAPI *glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) DECLSPEC_HIDDEN; 865 void (WINE_GLAPI *glColorMaterial)(GLenum face, GLenum mode) DECLSPEC_HIDDEN; 866 void (WINE_GLAPI *glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 867 void (WINE_GLAPI *glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) DECLSPEC_HIDDEN; 868 void (WINE_GLAPI *glCopyTexImage1D)(GLenum target, GLint level, 869 GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) DECLSPEC_HIDDEN; 870 void (WINE_GLAPI *glCopyTexImage2D)(GLenum target, GLint level, 871 GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) DECLSPEC_HIDDEN; 872 void (WINE_GLAPI *glCopyTexSubImage1D)(GLenum target, GLint level, 873 GLint xoffset, GLint x, GLint y, GLsizei width) DECLSPEC_HIDDEN; 874 void (WINE_GLAPI *glCopyTexSubImage2D)(GLenum target, GLint level, 875 GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN; 876 void (WINE_GLAPI *glCullFace)(GLenum mode) DECLSPEC_HIDDEN; 877 void (WINE_GLAPI *glDeleteLists)(GLuint list, GLsizei range) DECLSPEC_HIDDEN; 878 void (WINE_GLAPI *glDeleteTextures)(GLsizei n, const GLuint *textures) DECLSPEC_HIDDEN; 879 void (WINE_GLAPI *glDepthFunc)(GLenum func) DECLSPEC_HIDDEN; 880 void (WINE_GLAPI *glDepthMask)(GLboolean flag) DECLSPEC_HIDDEN; 881 void (WINE_GLAPI *glDepthRange)(GLclampd nearParam, GLclampd farParam) DECLSPEC_HIDDEN; 882 void (WINE_GLAPI *glDisable)(GLenum cap) DECLSPEC_HIDDEN; 883 void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN; 884 void (WINE_GLAPI *glDisableClientState)(GLenum array) DECLSPEC_HIDDEN; 885 void (WINE_GLAPI *glDrawArrays)(GLenum mode, GLint first, GLsizei count) DECLSPEC_HIDDEN; 886 void (WINE_GLAPI *glDrawBuffer)(GLenum mode) DECLSPEC_HIDDEN; 887 void (WINE_GLAPI *glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) DECLSPEC_HIDDEN; 888 void (WINE_GLAPI *glDrawPixels)(GLsizei width, GLsizei height, GLenum format, 889 GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN; 890 void (WINE_GLAPI *glEdgeFlag)(GLboolean flag) DECLSPEC_HIDDEN; 891 void (WINE_GLAPI *glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 892 void (WINE_GLAPI *glEdgeFlagv)(const GLboolean *flag) DECLSPEC_HIDDEN; 893 void (WINE_GLAPI *glEnable)(GLenum cap) DECLSPEC_HIDDEN; 894 void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN; 895 void (WINE_GLAPI *glEnableClientState)(GLenum array) DECLSPEC_HIDDEN; 896 void (WINE_GLAPI *glEnd)(void) DECLSPEC_HIDDEN; 897 void (WINE_GLAPI *glEndList)(void) DECLSPEC_HIDDEN; 898 void (WINE_GLAPI *glEvalCoord1d)(GLdouble u) DECLSPEC_HIDDEN; 899 void (WINE_GLAPI *glEvalCoord1dv)(const GLdouble *u) DECLSPEC_HIDDEN; 900 void (WINE_GLAPI *glEvalCoord1f)(GLfloat u) DECLSPEC_HIDDEN; 901 void (WINE_GLAPI *glEvalCoord1fv)(const GLfloat *u) DECLSPEC_HIDDEN; 902 void (WINE_GLAPI *glEvalCoord2d)(GLdouble u, GLdouble v) DECLSPEC_HIDDEN; 903 void (WINE_GLAPI *glEvalCoord2dv)(const GLdouble *u) DECLSPEC_HIDDEN; 904 void (WINE_GLAPI *glEvalCoord2f)(GLfloat u, GLfloat v) DECLSPEC_HIDDEN; 905 void (WINE_GLAPI *glEvalCoord2fv)(const GLfloat *u) DECLSPEC_HIDDEN; 906 void (WINE_GLAPI *glEvalMesh1)(GLenum mode, GLint i1, GLint i2) DECLSPEC_HIDDEN; 907 void (WINE_GLAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) DECLSPEC_HIDDEN; 908 void (WINE_GLAPI *glEvalPoint1)(GLint i) DECLSPEC_HIDDEN; 909 void (WINE_GLAPI *glEvalPoint2)(GLint i, GLint j) DECLSPEC_HIDDEN; 910 void (WINE_GLAPI *glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer) DECLSPEC_HIDDEN; 911 void (WINE_GLAPI *glFogf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 912 void (WINE_GLAPI *glFogfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 913 void (WINE_GLAPI *glFogi)(GLenum pname, GLint param) DECLSPEC_HIDDEN; 914 void (WINE_GLAPI *glFogiv)(GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 915 void (WINE_GLAPI *glFrontFace)(GLenum mode) DECLSPEC_HIDDEN; 916 void (WINE_GLAPI *glFrustum)(GLdouble left, GLdouble right, GLdouble bottom, 917 GLdouble top, GLdouble zNear, GLdouble zFar) DECLSPEC_HIDDEN; 918 GLuint (WINE_GLAPI *glGenLists)(GLsizei range) DECLSPEC_HIDDEN; 919 void (WINE_GLAPI *glGenTextures)(GLsizei n, GLuint *textures) DECLSPEC_HIDDEN; 920 void (WINE_GLAPI *glGetBooleanv)(GLenum pname, GLboolean *params) DECLSPEC_HIDDEN; 921 void (WINE_GLAPI *glGetClipPlane)(GLenum plane, GLdouble *equation) DECLSPEC_HIDDEN; 922 void (WINE_GLAPI *glGetDoublev)(GLenum pname, GLdouble *params) DECLSPEC_HIDDEN; 923 GLenum (WINE_GLAPI *glGetError)(void) DECLSPEC_HIDDEN; 924 void (WINE_GLAPI *glGetFloatv)(GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 925 void (WINE_GLAPI *glGetIntegerv)(GLenum pname, GLint *params) DECLSPEC_HIDDEN; 926 void (WINE_GLAPI *glGetLightfv)(GLenum light, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 927 void (WINE_GLAPI *glGetLightiv)(GLenum light, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 928 void (WINE_GLAPI *glGetMapdv)(GLenum target, GLenum query, GLdouble *v) DECLSPEC_HIDDEN; 929 void (WINE_GLAPI *glGetMapfv)(GLenum target, GLenum query, GLfloat *v) DECLSPEC_HIDDEN; 930 void (WINE_GLAPI *glGetMapiv)(GLenum target, GLenum query, GLint *v) DECLSPEC_HIDDEN; 931 void (WINE_GLAPI *glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 932 void (WINE_GLAPI *glGetMaterialiv)(GLenum face, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 933 void (WINE_GLAPI *glGetPixelMapfv)(GLenum map, GLfloat *values) DECLSPEC_HIDDEN; 934 void (WINE_GLAPI *glGetPixelMapuiv)(GLenum map, GLuint *values) DECLSPEC_HIDDEN; 935 void (WINE_GLAPI *glGetPixelMapusv)(GLenum map, GLushort *values) DECLSPEC_HIDDEN; 936 void (WINE_GLAPI *glGetPointerv)(GLenum pname, GLvoid **params) DECLSPEC_HIDDEN; 937 void (WINE_GLAPI *glGetPolygonStipple)(GLubyte *mask) DECLSPEC_HIDDEN; 938 const GLubyte * (WINE_GLAPI *glGetString)(GLenum name) DECLSPEC_HIDDEN; 939 void (WINE_GLAPI *glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 940 void (WINE_GLAPI *glGetTexEnviv)(GLenum target, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 941 void (WINE_GLAPI *glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params) DECLSPEC_HIDDEN; 942 void (WINE_GLAPI *glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 943 void (WINE_GLAPI *glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 944 void (WINE_GLAPI *glGetTexImage)(GLenum target, GLint level, GLenum format, 945 GLenum type, GLvoid *pixels) DECLSPEC_HIDDEN; 946 void (WINE_GLAPI *glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 947 void (WINE_GLAPI *glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 948 void (WINE_GLAPI *glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) DECLSPEC_HIDDEN; 949 void (WINE_GLAPI *glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) DECLSPEC_HIDDEN; 950 void (WINE_GLAPI *glHint)(GLenum target, GLenum mode) DECLSPEC_HIDDEN; 951 void (WINE_GLAPI *glIndexMask)(GLuint mask) DECLSPEC_HIDDEN; 952 void (WINE_GLAPI *glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 953 void (WINE_GLAPI *glIndexd)(GLdouble c) DECLSPEC_HIDDEN; 954 void (WINE_GLAPI *glIndexdv)(const GLdouble *c) DECLSPEC_HIDDEN; 955 void (WINE_GLAPI *glIndexf)(GLfloat c) DECLSPEC_HIDDEN; 956 void (WINE_GLAPI *glIndexfv)(const GLfloat *c) DECLSPEC_HIDDEN; 957 void (WINE_GLAPI *glIndexi)(GLint c) DECLSPEC_HIDDEN; 958 void (WINE_GLAPI *glIndexiv)(const GLint *c) DECLSPEC_HIDDEN; 959 void (WINE_GLAPI *glIndexs)(GLshort c) DECLSPEC_HIDDEN; 960 void (WINE_GLAPI *glIndexsv)(const GLshort *c) DECLSPEC_HIDDEN; 961 void (WINE_GLAPI *glIndexub)(GLubyte c) DECLSPEC_HIDDEN; 962 void (WINE_GLAPI *glIndexubv)(const GLubyte *c) DECLSPEC_HIDDEN; 963 void (WINE_GLAPI *glInitNames)(void) DECLSPEC_HIDDEN; 964 void (WINE_GLAPI *glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 965 GLboolean (WINE_GLAPI *glIsEnabled)(GLenum cap) DECLSPEC_HIDDEN; 966 GLboolean (WINE_GLAPI *glIsList)(GLuint list) DECLSPEC_HIDDEN; 967 GLboolean (WINE_GLAPI *glIsTexture)(GLuint texture) DECLSPEC_HIDDEN; 968 void (WINE_GLAPI *glLightModelf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 969 void (WINE_GLAPI *glLightModelfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 970 void (WINE_GLAPI *glLightModeli)(GLenum pname, GLint param) DECLSPEC_HIDDEN; 971 void (WINE_GLAPI *glLightModeliv)(GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 972 void (WINE_GLAPI *glLightf)(GLenum light, GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 973 void (WINE_GLAPI *glLightfv)(GLenum light, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 974 void (WINE_GLAPI *glLighti)(GLenum light, GLenum pname, GLint param) DECLSPEC_HIDDEN; 975 void (WINE_GLAPI *glLightiv)(GLenum light, GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 976 void (WINE_GLAPI *glLineStipple)(GLint factor, GLushort pattern) DECLSPEC_HIDDEN; 977 void (WINE_GLAPI *glLineWidth)(GLfloat width) DECLSPEC_HIDDEN; 978 void (WINE_GLAPI *glListBase)(GLuint base) DECLSPEC_HIDDEN; 979 void (WINE_GLAPI *glLoadIdentity)(void) DECLSPEC_HIDDEN; 980 void (WINE_GLAPI *glLoadMatrixd)(const GLdouble *m) DECLSPEC_HIDDEN; 981 void (WINE_GLAPI *glLoadMatrixf)(const GLfloat *m) DECLSPEC_HIDDEN; 982 void (WINE_GLAPI *glLoadName)(GLuint name) DECLSPEC_HIDDEN; 983 void (WINE_GLAPI *glLogicOp)(GLenum opcode) DECLSPEC_HIDDEN; 984 void (WINE_GLAPI *glMap1d)(GLenum target, GLdouble u1, GLdouble u2, 985 GLint stride, GLint order, const GLdouble *points) DECLSPEC_HIDDEN; 986 void (WINE_GLAPI *glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, 987 GLint order, const GLfloat *points) DECLSPEC_HIDDEN; 988 void (WINE_GLAPI *glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, 989 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) DECLSPEC_HIDDEN; 990 void (WINE_GLAPI *glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, 991 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) DECLSPEC_HIDDEN; 992 void (WINE_GLAPI *glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2) DECLSPEC_HIDDEN; 993 void (WINE_GLAPI *glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2) DECLSPEC_HIDDEN; 994 void (WINE_GLAPI *glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) DECLSPEC_HIDDEN; 995 void (WINE_GLAPI *glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) DECLSPEC_HIDDEN; 996 void (WINE_GLAPI *glMaterialf)(GLenum face, GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 997 void (WINE_GLAPI *glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 998 void (WINE_GLAPI *glMateriali)(GLenum face, GLenum pname, GLint param) DECLSPEC_HIDDEN; 999 void (WINE_GLAPI *glMaterialiv)(GLenum face, GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 1000 void (WINE_GLAPI *glMatrixMode)(GLenum mode) DECLSPEC_HIDDEN; 1001 void (WINE_GLAPI *glMultMatrixd)(const GLdouble *m) DECLSPEC_HIDDEN; 1002 void (WINE_GLAPI *glMultMatrixf)(const GLfloat *m) DECLSPEC_HIDDEN; 1003 void (WINE_GLAPI *glNewList)(GLuint list, GLenum mode) DECLSPEC_HIDDEN; 1004 void (WINE_GLAPI *glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz) DECLSPEC_HIDDEN; 1005 void (WINE_GLAPI *glNormal3bv)(const GLbyte *v) DECLSPEC_HIDDEN; 1006 void (WINE_GLAPI *glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz) DECLSPEC_HIDDEN; 1007 void (WINE_GLAPI *glNormal3dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1008 void (WINE_GLAPI *glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz) DECLSPEC_HIDDEN; 1009 void (WINE_GLAPI *glNormal3fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1010 void (WINE_GLAPI *glNormal3i)(GLint nx, GLint ny, GLint nz) DECLSPEC_HIDDEN; 1011 void (WINE_GLAPI *glNormal3iv)(const GLint *v) DECLSPEC_HIDDEN; 1012 void (WINE_GLAPI *glNormal3s)(GLshort nx, GLshort ny, GLshort nz) DECLSPEC_HIDDEN; 1013 void (WINE_GLAPI *glNormal3sv)(const GLshort *v) DECLSPEC_HIDDEN; 1014 void (WINE_GLAPI *glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 1015 void (WINE_GLAPI *glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, 1016 GLdouble top, GLdouble zNear, GLdouble zFar) DECLSPEC_HIDDEN; 1017 void (WINE_GLAPI *glPassThrough)(GLfloat token) DECLSPEC_HIDDEN; 1018 void (WINE_GLAPI *glPixelMapfv)(GLenum map, GLint mapsize, const GLfloat *values) DECLSPEC_HIDDEN; 1019 void (WINE_GLAPI *glPixelMapuiv)(GLenum map, GLint mapsize, const GLuint *values) DECLSPEC_HIDDEN; 1020 void (WINE_GLAPI *glPixelMapusv)(GLenum map, GLint mapsize, const GLushort *values) DECLSPEC_HIDDEN; 1021 void (WINE_GLAPI *glPixelStoref)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 1022 void (WINE_GLAPI *glPixelStorei)(GLenum pname, GLint param) DECLSPEC_HIDDEN; 1023 void (WINE_GLAPI *glPixelTransferf)(GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 1024 void (WINE_GLAPI *glPixelTransferi)(GLenum pname, GLint param) DECLSPEC_HIDDEN; 1025 void (WINE_GLAPI *glPixelZoom)(GLfloat xfactor, GLfloat yfactor) DECLSPEC_HIDDEN; 1026 void (WINE_GLAPI *glPointSize)(GLfloat size) DECLSPEC_HIDDEN; 1027 void (WINE_GLAPI *glPolygonMode)(GLenum face, GLenum mode) DECLSPEC_HIDDEN; 1028 void (WINE_GLAPI *glPolygonOffset)(GLfloat factor, GLfloat units) DECLSPEC_HIDDEN; 1029 void (WINE_GLAPI *glPolygonStipple)(const GLubyte *mask) DECLSPEC_HIDDEN; 1030 void (WINE_GLAPI *glPopAttrib)(void) DECLSPEC_HIDDEN; 1031 void (WINE_GLAPI *glPopClientAttrib)(void) DECLSPEC_HIDDEN; 1032 void (WINE_GLAPI *glPopMatrix)(void) DECLSPEC_HIDDEN; 1033 void (WINE_GLAPI *glPopName)(void) DECLSPEC_HIDDEN; 1034 void (WINE_GLAPI *glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities) DECLSPEC_HIDDEN; 1035 void (WINE_GLAPI *glPushAttrib)(GLbitfield mask) DECLSPEC_HIDDEN; 1036 void (WINE_GLAPI *glPushClientAttrib)(GLbitfield mask) DECLSPEC_HIDDEN; 1037 void (WINE_GLAPI *glPushMatrix)(void) DECLSPEC_HIDDEN; 1038 void (WINE_GLAPI *glPushName)(GLuint name) DECLSPEC_HIDDEN; 1039 void (WINE_GLAPI *glRasterPos2d)(GLdouble x, GLdouble y) DECLSPEC_HIDDEN; 1040 void (WINE_GLAPI *glRasterPos2dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1041 void (WINE_GLAPI *glRasterPos2f)(GLfloat x, GLfloat y) DECLSPEC_HIDDEN; 1042 void (WINE_GLAPI *glRasterPos2fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1043 void (WINE_GLAPI *glRasterPos2i)(GLint x, GLint y) DECLSPEC_HIDDEN; 1044 void (WINE_GLAPI *glRasterPos2iv)(const GLint *v) DECLSPEC_HIDDEN; 1045 void (WINE_GLAPI *glRasterPos2s)(GLshort x, GLshort y) DECLSPEC_HIDDEN; 1046 void (WINE_GLAPI *glRasterPos2sv)(const GLshort *v) DECLSPEC_HIDDEN; 1047 void (WINE_GLAPI *glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN; 1048 void (WINE_GLAPI *glRasterPos3dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1049 void (WINE_GLAPI *glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN; 1050 void (WINE_GLAPI *glRasterPos3fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1051 void (WINE_GLAPI *glRasterPos3i)(GLint x, GLint y, GLint z) DECLSPEC_HIDDEN; 1052 void (WINE_GLAPI *glRasterPos3iv)(const GLint *v) DECLSPEC_HIDDEN; 1053 void (WINE_GLAPI *glRasterPos3s)(GLshort x, GLshort y, GLshort z) DECLSPEC_HIDDEN; 1054 void (WINE_GLAPI *glRasterPos3sv)(const GLshort *v) DECLSPEC_HIDDEN; 1055 void (WINE_GLAPI *glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) DECLSPEC_HIDDEN; 1056 void (WINE_GLAPI *glRasterPos4dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1057 void (WINE_GLAPI *glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) DECLSPEC_HIDDEN; 1058 void (WINE_GLAPI *glRasterPos4fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1059 void (WINE_GLAPI *glRasterPos4i)(GLint x, GLint y, GLint z, GLint w) DECLSPEC_HIDDEN; 1060 void (WINE_GLAPI *glRasterPos4iv)(const GLint *v) DECLSPEC_HIDDEN; 1061 void (WINE_GLAPI *glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w) DECLSPEC_HIDDEN; 1062 void (WINE_GLAPI *glRasterPos4sv)(const GLshort *v) DECLSPEC_HIDDEN; 1063 void (WINE_GLAPI *glReadBuffer)(GLenum mode) DECLSPEC_HIDDEN; 1064 void (WINE_GLAPI *glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, 1065 GLenum format, GLenum type, GLvoid *pixels) DECLSPEC_HIDDEN; 1066 void (WINE_GLAPI *glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) DECLSPEC_HIDDEN; 1067 void (WINE_GLAPI *glRectdv)(const GLdouble *v1, const GLdouble *v2) DECLSPEC_HIDDEN; 1068 void (WINE_GLAPI *glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) DECLSPEC_HIDDEN; 1069 void (WINE_GLAPI *glRectfv)(const GLfloat *v1, const GLfloat *v2) DECLSPEC_HIDDEN; 1070 void (WINE_GLAPI *glRecti)(GLint x1, GLint y1, GLint x2, GLint y2) DECLSPEC_HIDDEN; 1071 void (WINE_GLAPI *glRectiv)(const GLint *v1, const GLint *v2) DECLSPEC_HIDDEN; 1072 void (WINE_GLAPI *glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2) DECLSPEC_HIDDEN; 1073 void (WINE_GLAPI *glRectsv)(const GLshort *v1, const GLshort *v2) DECLSPEC_HIDDEN; 1074 GLint (WINE_GLAPI *glRenderMode)(GLenum mode) DECLSPEC_HIDDEN; 1075 void (WINE_GLAPI *glRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN; 1076 void (WINE_GLAPI *glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN; 1077 void (WINE_GLAPI *glScaled)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN; 1078 void (WINE_GLAPI *glScalef)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN; 1079 void (WINE_GLAPI *glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN; 1080 void (WINE_GLAPI *glSelectBuffer)(GLsizei size, GLuint *buffer) DECLSPEC_HIDDEN; 1081 void (WINE_GLAPI *glShadeModel)(GLenum mode) DECLSPEC_HIDDEN; 1082 void (WINE_GLAPI *glStencilFunc)(GLenum func, GLint ref, GLuint mask) DECLSPEC_HIDDEN; 1083 void (WINE_GLAPI *glStencilMask)(GLuint mask) DECLSPEC_HIDDEN; 1084 void (WINE_GLAPI *glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) DECLSPEC_HIDDEN; 1085 void (WINE_GLAPI *glTexCoord1d)(GLdouble s) DECLSPEC_HIDDEN; 1086 void (WINE_GLAPI *glTexCoord1dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1087 void (WINE_GLAPI *glTexCoord1f)(GLfloat s) DECLSPEC_HIDDEN; 1088 void (WINE_GLAPI *glTexCoord1fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1089 void (WINE_GLAPI *glTexCoord1i)(GLint s) DECLSPEC_HIDDEN; 1090 void (WINE_GLAPI *glTexCoord1iv)(const GLint *v) DECLSPEC_HIDDEN; 1091 void (WINE_GLAPI *glTexCoord1s)(GLshort s) DECLSPEC_HIDDEN; 1092 void (WINE_GLAPI *glTexCoord1sv)(const GLshort *v) DECLSPEC_HIDDEN; 1093 void (WINE_GLAPI *glTexCoord2d)(GLdouble s, GLdouble t) DECLSPEC_HIDDEN; 1094 void (WINE_GLAPI *glTexCoord2dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1095 void (WINE_GLAPI *glTexCoord2f)(GLfloat s, GLfloat t) DECLSPEC_HIDDEN; 1096 void (WINE_GLAPI *glTexCoord2fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1097 void (WINE_GLAPI *glTexCoord2i)(GLint s, GLint t) DECLSPEC_HIDDEN; 1098 void (WINE_GLAPI *glTexCoord2iv)(const GLint *v) DECLSPEC_HIDDEN; 1099 void (WINE_GLAPI *glTexCoord2s)(GLshort s, GLshort t) DECLSPEC_HIDDEN; 1100 void (WINE_GLAPI *glTexCoord2sv)(const GLshort *v) DECLSPEC_HIDDEN; 1101 void (WINE_GLAPI *glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r) DECLSPEC_HIDDEN; 1102 void (WINE_GLAPI *glTexCoord3dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1103 void (WINE_GLAPI *glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r) DECLSPEC_HIDDEN; 1104 void (WINE_GLAPI *glTexCoord3fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1105 void (WINE_GLAPI *glTexCoord3i)(GLint s, GLint t, GLint r) DECLSPEC_HIDDEN; 1106 void (WINE_GLAPI *glTexCoord3iv)(const GLint *v) DECLSPEC_HIDDEN; 1107 void (WINE_GLAPI *glTexCoord3s)(GLshort s, GLshort t, GLshort r) DECLSPEC_HIDDEN; 1108 void (WINE_GLAPI *glTexCoord3sv)(const GLshort *v) DECLSPEC_HIDDEN; 1109 void (WINE_GLAPI *glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q) DECLSPEC_HIDDEN; 1110 void (WINE_GLAPI *glTexCoord4dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1111 void (WINE_GLAPI *glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q) DECLSPEC_HIDDEN; 1112 void (WINE_GLAPI *glTexCoord4fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1113 void (WINE_GLAPI *glTexCoord4i)(GLint s, GLint t, GLint r, GLint q) DECLSPEC_HIDDEN; 1114 void (WINE_GLAPI *glTexCoord4iv)(const GLint *v) DECLSPEC_HIDDEN; 1115 void (WINE_GLAPI *glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q) DECLSPEC_HIDDEN; 1116 void (WINE_GLAPI *glTexCoord4sv)(const GLshort *v) DECLSPEC_HIDDEN; 1117 void (WINE_GLAPI *glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 1118 void (WINE_GLAPI *glTexEnvf)(GLenum target, GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 1119 void (WINE_GLAPI *glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 1120 void (WINE_GLAPI *glTexEnvi)(GLenum target, GLenum pname, GLint param) DECLSPEC_HIDDEN; 1121 void (WINE_GLAPI *glTexEnviv)(GLenum target, GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 1122 void (WINE_GLAPI *glTexGend)(GLenum coord, GLenum pname, GLdouble param) DECLSPEC_HIDDEN; 1123 void (WINE_GLAPI *glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params) DECLSPEC_HIDDEN; 1124 void (WINE_GLAPI *glTexGenf)(GLenum coord, GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 1125 void (WINE_GLAPI *glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 1126 void (WINE_GLAPI *glTexGeni)(GLenum coord, GLenum pname, GLint param) DECLSPEC_HIDDEN; 1127 void (WINE_GLAPI *glTexGeniv)(GLenum coord, GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 1128 void (WINE_GLAPI *glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, 1129 GLint border, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN; 1130 void (WINE_GLAPI *glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, 1131 GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN; 1132 void (WINE_GLAPI *glTexParameterf)(GLenum target, GLenum pname, GLfloat param) DECLSPEC_HIDDEN; 1133 void (WINE_GLAPI *glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 1134 void (WINE_GLAPI *glTexParameteri)(GLenum target, GLenum pname, GLint param) DECLSPEC_HIDDEN; 1135 void (WINE_GLAPI *glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) DECLSPEC_HIDDEN; 1136 void (WINE_GLAPI *glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, 1137 GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN; 1138 void (WINE_GLAPI *glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, 1139 GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) DECLSPEC_HIDDEN; 1140 void (WINE_GLAPI *glTranslated)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN; 1141 void (WINE_GLAPI *glTranslatef)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN; 1142 void (WINE_GLAPI *glVertex2d)(GLdouble x, GLdouble y) DECLSPEC_HIDDEN; 1143 void (WINE_GLAPI *glVertex2dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1144 void (WINE_GLAPI *glVertex2f)(GLfloat x, GLfloat y) DECLSPEC_HIDDEN; 1145 void (WINE_GLAPI *glVertex2fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1146 void (WINE_GLAPI *glVertex2i)(GLint x, GLint y) DECLSPEC_HIDDEN; 1147 void (WINE_GLAPI *glVertex2iv)(const GLint *v) DECLSPEC_HIDDEN; 1148 void (WINE_GLAPI *glVertex2s)(GLshort x, GLshort y) DECLSPEC_HIDDEN; 1149 void (WINE_GLAPI *glVertex2sv)(const GLshort *v) DECLSPEC_HIDDEN; 1150 void (WINE_GLAPI *glVertex3d)(GLdouble x, GLdouble y, GLdouble z) DECLSPEC_HIDDEN; 1151 void (WINE_GLAPI *glVertex3dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1152 void (WINE_GLAPI *glVertex3f)(GLfloat x, GLfloat y, GLfloat z) DECLSPEC_HIDDEN; 1153 void (WINE_GLAPI *glVertex3fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1154 void (WINE_GLAPI *glVertex3i)(GLint x, GLint y, GLint z) DECLSPEC_HIDDEN; 1155 void (WINE_GLAPI *glVertex3iv)(const GLint *v) DECLSPEC_HIDDEN; 1156 void (WINE_GLAPI *glVertex3s)(GLshort x, GLshort y, GLshort z) DECLSPEC_HIDDEN; 1157 void (WINE_GLAPI *glVertex3sv)(const GLshort *v) DECLSPEC_HIDDEN; 1158 void (WINE_GLAPI *glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) DECLSPEC_HIDDEN; 1159 void (WINE_GLAPI *glVertex4dv)(const GLdouble *v) DECLSPEC_HIDDEN; 1160 void (WINE_GLAPI *glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) DECLSPEC_HIDDEN; 1161 void (WINE_GLAPI *glVertex4fv)(const GLfloat *v) DECLSPEC_HIDDEN; 1162 void (WINE_GLAPI *glVertex4i)(GLint x, GLint y, GLint z, GLint w) DECLSPEC_HIDDEN; 1163 void (WINE_GLAPI *glVertex4iv)(const GLint *v) DECLSPEC_HIDDEN; 1164 void (WINE_GLAPI *glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w) DECLSPEC_HIDDEN; 1165 void (WINE_GLAPI *glVertex4sv)(const GLshort *v) DECLSPEC_HIDDEN; 1166 void (WINE_GLAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) DECLSPEC_HIDDEN; 1167 void (WINE_GLAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) DECLSPEC_HIDDEN; 1168 void (WINE_GLAPI *glPointParameterfv)(GLenum pname, const GLfloat *params) DECLSPEC_HIDDEN; 1151 1169 1152 1170 /* glFinish and glFlush are always loaded from opengl32.dll, thus they always have 1153 * __stdcall calling convention 1171 * __stdcall calling convention. 1172 * 1173 * They are wgl functions and must not be called inside the gl lock, give them a 1174 * name that makes this clear 1154 1175 */ 1155 void (__stdcall *glFinish) ();1156 void (__stdcall *glFlush) ();1176 void (__stdcall *wglFinish)(void) DECLSPEC_HIDDEN; 1177 void (__stdcall *wglFlush)(void) DECLSPEC_HIDDEN; 1157 1178 1158 1179 /* WGL functions */ 1159 HGLRC (WINAPI *pwglCreateContext)(HDC);1160 BOOL (WINAPI *pwglDeleteContext)(HGLRC);1161 HGLRC (WINAPI *pwglGetCurrentContext)(void);1162 HDC (WINAPI *pwglGetCurrentDC)(void);1163 PROC (WINAPI *pwglGetProcAddress)(LPCSTR);1164 BOOL (WINAPI *pwglMakeCurrent)(HDC,HGLRC);1165 BOOL (WINAPI *pwglShareLists)(HGLRC,HGLRC);1180 HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN; 1181 BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN; 1182 HGLRC (WINAPI *pwglGetCurrentContext)(void) DECLSPEC_HIDDEN; 1183 HDC (WINAPI *pwglGetCurrentDC)(void) DECLSPEC_HIDDEN; 1184 PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; 1185 BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN; 1186 BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN; 1166 1187 1167 1188 #define GL_FUNCS_GEN \ … … 1535 1556 #endif 1536 1557 1558 /* GL_ARB_depth_clamp */ 1559 #ifndef GL_ARB_depth_clamp 1560 #define GL_ARB_depth_clamp 1 1561 #define GL_DEPTH_CLAMP 0x864f 1562 #endif 1563 1537 1564 /* GL_ARB_depth_texture */ 1538 1565 #ifndef GL_ARB_depth_texture … … 1567 1594 #endif 1568 1595 typedef void (WINE_GLAPI *PGLFNDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); 1596 1597 /* GL_ARB_framebuffer_object */ 1598 #ifndef GL_ARB_framebuffer_object 1599 #define GL_ARB_framebuffer_object 1 1600 #define GL_FRAMEBUFFER 0x8d40 1601 #define GL_READ_FRAMEBUFFER 0x8ca8 1602 #define GL_DRAW_FRAMEBUFFER 0x8ca9 1603 #define GL_RENDERBUFFER 0x8d41 1604 #define GL_STENCIL_INDEX1 0x8d46 1605 #define GL_STENCIL_INDEX4 0x8d47 1606 #define GL_STENCIL_INDEX8 0x8d48 1607 #define GL_STENCIL_INDEX16 0x8d49 1608 #define GL_RENDERBUFFER_WIDTH 0x8d42 1609 #define GL_RENDERBUFFER_HEIGHT 0x8d43 1610 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8d44 1611 #define GL_RENDERBUFFER_RED_SIZE 0x8d50 1612 #define GL_RENDERBUFFER_GREEN_SIZE 0x8d51 1613 #define GL_RENDERBUFFER_BLUE_SIZE 0x8d52 1614 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8d53 1615 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8d54 1616 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8d55 1617 #define GL_RENDERBUFFER_SAMPLES 0x8cab 1618 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8cd0 1619 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8cd1 1620 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8cd2 1621 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8cd3 1622 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8cd4 1623 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 1624 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 1625 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 1626 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 1627 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 1628 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 1629 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 1630 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 1631 #define GL_SRGB 0x8c40 1632 #define GL_UNSIGNED_NORMALIZED 0x8c17 1633 #define GL_FRAMEBUFFER_DEFAULT 0x8218 1634 #define GL_INDEX 0x8222 1635 #define GL_COLOR_ATTACHMENT0 0x8ce0 1636 #define GL_COLOR_ATTACHMENT1 0x8ce1 1637 #define GL_COLOR_ATTACHMENT2 0x8ce2 1638 #define GL_COLOR_ATTACHMENT3 0x8ce3 1639 #define GL_COLOR_ATTACHMENT4 0x8ce4 1640 #define GL_COLOR_ATTACHMENT5 0x8ce5 1641 #define GL_COLOR_ATTACHMENT6 0x8ce6 1642 #define GL_COLOR_ATTACHMENT7 0x8ce7 1643 #define GL_COLOR_ATTACHMENT8 0x8ce8 1644 #define GL_COLOR_ATTACHMENT9 0x8ce9 1645 #define GL_COLOR_ATTACHMENT10 0x8cea 1646 #define GL_COLOR_ATTACHMENT11 0x8ceb 1647 #define GL_COLOR_ATTACHMENT12 0x8cec 1648 #define GL_COLOR_ATTACHMENT13 0x8ced 1649 #define GL_COLOR_ATTACHMENT14 0x8cee 1650 #define GL_COLOR_ATTACHMENT15 0x8cef 1651 #define GL_DEPTH_ATTACHMENT 0x8d00 1652 #define GL_STENCIL_ATTACHMENT 0x8d20 1653 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821a 1654 #define GL_MAX_SAMPLES 0x8d57 1655 #define GL_FRAMEBUFFER_COMPLETE 0x8cd5 1656 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8cd6 1657 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8cd7 1658 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8cdb 1659 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8cdc 1660 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8cdd 1661 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8d56 1662 #define GL_FRAMEBUFFER_UNDEFINED 0x8219 1663 #define GL_FRAMEBUFFER_BINDING 0x8ca6 1664 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8ca6 1665 #define GL_READ_FRAMEBUFFER_BINDING 0x8caa 1666 #define GL_RENDERBUFFER_BINDING 0x8ca7 1667 #define GL_MAX_COLOR_ATTACHMENTS 0x8cdf 1668 #define GL_MAX_RENDERBUFFER_SIZE 0x84e8 1669 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 1670 #define GL_DEPTH_STENCIL 0x84f9 1671 #define GL_UNSIGNED_INT_24_8 0x84fa 1672 #define GL_DEPTH24_STENCIL8 0x88f0 1673 #define GL_TEXTURE_STENCIL_SIZE 0x88f1 1674 #endif 1675 typedef GLboolean (WINE_GLAPI * PGLFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); 1676 typedef void (WINE_GLAPI * PGLFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); 1677 typedef void (WINE_GLAPI * PGLFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint *renderbuffers); 1678 typedef void (WINE_GLAPI * PGLFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint *renderbuffers); 1679 typedef void (WINE_GLAPI * PGLFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, 1680 GLsizei width, GLsizei height); 1681 typedef void (WINE_GLAPI * PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, 1682 GLenum internalformat, GLsizei width, GLsizei height); 1683 typedef void (WINE_GLAPI * PGLFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); 1684 typedef GLboolean (WINE_GLAPI * PGLFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); 1685 typedef void (WINE_GLAPI * PGLFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); 1686 typedef void (WINE_GLAPI * PGLFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint *framebuffers); 1687 typedef void (WINE_GLAPI * PGLFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint *framebuffers); 1688 typedef GLenum (WINE_GLAPI * PGLFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); 1689 typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, 1690 GLenum textarget, GLuint texture, GLint level); 1691 typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, 1692 GLenum textarget, GLuint texture, GLint level); 1693 typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, 1694 GLenum textarget, GLuint texture, GLint level, GLint layer); 1695 typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, 1696 GLuint texture, GLint level, GLint layer); 1697 typedef void (WINE_GLAPI * PGLFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, 1698 GLenum renderbuffertarget, GLuint renderbuffer); 1699 typedef void (WINE_GLAPI * PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, 1700 GLenum pname, GLint *params); 1701 typedef void (WINE_GLAPI * PGLFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, 1702 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 1703 typedef void (WINE_GLAPI * PGLFNGLGENERATEMIPMAPPROC)(GLenum target); 1569 1704 1570 1705 /* GL_ARB_geometry_shader4 */ … … 1759 1894 typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); 1760 1895 typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); 1896 1897 /* GL_ARB_provoking_vertex */ 1898 #ifndef GL_ARB_provoking_vertex 1899 #define GL_ARB_provoking_vertex 1 1900 #define GL_FIRST_VERTEX_CONVENTION 0x8e4d 1901 #define GL_LAST_VERTEX_CONVENTION 0x8e4e 1902 #define GL_PROVOKING_VERTEX 0x8e4f 1903 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8e4c 1904 #endif 1905 typedef void (WINE_GLAPI * PGLFNGLPROVOKINGVERTEXPROC)(GLenum mode); 1906 1761 1907 /* GL_ARB_vertex_blend */ 1762 1908 #ifndef GL_ARB_vertex_blend … … 1962 2108 typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); 1963 2109 typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); 2110 2111 /* GL_EXT_provoking_vertex */ 2112 #ifndef GL_EXT_provoking_vertex 2113 #define GL_EXT_provoking_vertex 1 2114 #define GL_FIRST_VERTEX_CONVENTION_EXT 0x8e4d 2115 #define GL_LAST_VERTEX_CONVENTION_EXT 0x8e4e 2116 #define GL_PROVOKING_VERTEX_EXT 0x8e4f 2117 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8e4c 2118 #endif 2119 typedef void (WINE_GLAPI * PGLFNGLPROVOKINGVERTEXEXTPROC)(GLenum mode); 2120 1964 2121 /* GL_EXT_texture3D */ 1965 2122 #ifndef GL_EXT_texture3D … … 3021 3178 typedef void (WINE_GLAPI *PGLFNBINDFRAGMENTSHADERATI) (GLuint id); 3022 3179 typedef void (WINE_GLAPI *PGLFNDELETEFRAGMENTSHADERATI) (GLuint id); 3023 typedef void (WINE_GLAPI *PGLFNBEGINFRAGMENTSHADERATI) ( );3024 typedef void (WINE_GLAPI *PGLFNENDFRAGMENTSHADERATI) ( );3180 typedef void (WINE_GLAPI *PGLFNBEGINFRAGMENTSHADERATI) (void); 3181 typedef void (WINE_GLAPI *PGLFNENDFRAGMENTSHADERATI) (void); 3025 3182 typedef void (WINE_GLAPI *PGLFNPASSTEXCOORDATI) (GLuint dst, GLuint coord, GLenum swizzle); 3026 3183 typedef void (WINE_GLAPI *PGLFNSAMPLEMAPATI) (GLuint dst, GLuint interp, GLenum swizzle); … … 3393 3550 #define WINE_DEFAULT_VIDMEM 64*1024*1024 3394 3551 3395 typedef enum _GL_VSVersion {3396 VS_VERSION_NOT_SUPPORTED = 0x0,3397 VS_VERSION_10 = 0x10,3398 VS_VERSION_11 = 0x11,3399 VS_VERSION_20 = 0x20,3400 VS_VERSION_30 = 0x30,3401 /*Force 32-bits*/3402 VS_VERSION_FORCE_DWORD = 0x7FFFFFFF3403 } GL_VSVersion;3404 3405 typedef enum _GL_PSVersion {3406 PS_VERSION_NOT_SUPPORTED = 0x0,3407 PS_VERSION_10 = 0x10,3408 PS_VERSION_11 = 0x11,3409 PS_VERSION_12 = 0x12,3410 PS_VERSION_13 = 0x13,3411 PS_VERSION_14 = 0x14,3412 PS_VERSION_20 = 0x20,3413 PS_VERSION_30 = 0x30,3414 /*Force 32-bits*/3415 PS_VERSION_FORCE_DWORD = 0x7FFFFFFF3416 } GL_PSVersion;3417 3418 3552 #define MAKEDWORD_VERSION(maj, min) ((maj & 0x0000FFFF) << 16) | (min & 0x0000FFFF) 3419 3553 … … 3424 3558 ARB_COLOR_BUFFER_FLOAT, 3425 3559 ARB_DEPTH_BUFFER_FLOAT, 3560 ARB_DEPTH_CLAMP, 3426 3561 ARB_DEPTH_TEXTURE, 3427 3562 ARB_DRAW_BUFFERS, 3428 3563 ARB_FRAGMENT_PROGRAM, 3429 3564 ARB_FRAGMENT_SHADER, 3565 ARB_FRAMEBUFFER_OBJECT, 3430 3566 ARB_GEOMETRY_SHADER4, 3431 3567 ARB_IMAGING, … … 3434 3570 ARB_OCCLUSION_QUERY, 3435 3571 ARB_POINT_PARAMETERS, 3572 ARB_PROVOKING_VERTEX, 3436 3573 ARB_PIXEL_BUFFER_OBJECT, 3437 3574 ARB_POINT_SPRITE, … … 3468 3605 EXT_PIXEL_BUFFER_OBJECT, 3469 3606 EXT_POINT_PARAMETERS, 3607 EXT_PROVOKING_VERTEX, 3470 3608 EXT_SECONDARY_COLOR, 3471 3609 EXT_STENCIL_TWO_SIDE, … … 3544 3682 /* GL_ARB_draw_buffers */ \ 3545 3683 USE_GL_FUNC(PGLFNDRAWBUFFERSARBPROC, glDrawBuffersARB, ARB_DRAW_BUFFERS, NULL )\ 3684 /* GL_ARB_framebuffer_object */ \ 3685 USE_GL_FUNC(PGLFNGLISRENDERBUFFERPROC, glIsRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3686 USE_GL_FUNC(PGLFNGLBINDRENDERBUFFERPROC, glBindRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3687 USE_GL_FUNC(PGLFNGLDELETERENDERBUFFERSPROC, glDeleteRenderbuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3688 USE_GL_FUNC(PGLFNGLGENRENDERBUFFERSPROC, glGenRenderbuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3689 USE_GL_FUNC(PGLFNGLRENDERBUFFERSTORAGEPROC, glRenderbufferStorage, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3690 USE_GL_FUNC(PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3691 USE_GL_FUNC(PGLFNGLGETRENDERBUFFERPARAMETERIVPROC, glGetRenderbufferParameteriv, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3692 USE_GL_FUNC(PGLFNGLISFRAMEBUFFERPROC, glIsFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3693 USE_GL_FUNC(PGLFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3694 USE_GL_FUNC(PGLFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3695 USE_GL_FUNC(PGLFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3696 USE_GL_FUNC(PGLFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3697 USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE1DPROC, glFramebufferTexture1D, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3698 USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3699 USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURE3DPROC, glFramebufferTexture3D, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3700 USE_GL_FUNC(PGLFNGLFRAMEBUFFERTEXTURELAYERPROC, glFramebufferTextureLayer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3701 USE_GL_FUNC(PGLFNGLFRAMEBUFFERRENDERBUFFERPROC, glFramebufferRenderbuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3702 USE_GL_FUNC(PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC, glGetFramebufferAttachmentParameteriv, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3703 USE_GL_FUNC(PGLFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3704 USE_GL_FUNC(PGLFNGLGENERATEMIPMAPPROC, glGenerateMipmap, ARB_FRAMEBUFFER_OBJECT, NULL )\ 3546 3705 /* GL_ARB_geometry_shader4 */ \ 3547 3706 USE_GL_FUNC(PGLFNPROGRAMPARAMETERIARBPROC, glProgramParameteriARB, ARB_GEOMETRY_SHADER4, NULL ) \ … … 3577 3736 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFARBPROC, glPointParameterfARB, ARB_POINT_PARAMETERS, NULL )\ 3578 3737 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVARBPROC, glPointParameterfvARB, ARB_POINT_PARAMETERS, NULL )\ 3738 /* GL_ARB_provoking_vertex */ \ 3739 USE_GL_FUNC(PGLFNGLPROVOKINGVERTEXPROC, glProvokingVertex, ARB_PROVOKING_VERTEX, NULL)\ 3579 3740 /* GL_ARB_texture_compression */ \ 3580 3741 USE_GL_FUNC(PGLFNCOMPRESSEDTEXIMAGE2DPROC, glCompressedTexImage2DARB, ARB_TEXTURE_COMPRESSION,NULL )\ … … 3644 3805 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFEXTPROC, glPointParameterfEXT, EXT_POINT_PARAMETERS, NULL )\ 3645 3806 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVEXTPROC, glPointParameterfvEXT, EXT_POINT_PARAMETERS, NULL )\ 3807 /* GL_EXT_provoking_vertex */ \ 3808 USE_GL_FUNC(PGLFNGLPROVOKINGVERTEXEXTPROC, glProvokingVertexEXT, EXT_PROVOKING_VERTEX, NULL)\ 3646 3809 /* GL_EXT_secondary_color */ \ 3647 3810 USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3UBEXTPROC, glSecondaryColor3ubEXT, EXT_SECONDARY_COLOR, NULL )\ … … 3958 4121 ****************************************************/ 3959 4122 4123 struct wined3d_fbo_ops 4124 { 4125 PGLFNGLISRENDERBUFFERPROC glIsRenderbuffer; 4126 PGLFNGLBINDRENDERBUFFERPROC glBindRenderbuffer; 4127 PGLFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers; 4128 PGLFNGLGENRENDERBUFFERSPROC glGenRenderbuffers; 4129 PGLFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage; 4130 PGLFNRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample; 4131 PGLFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv; 4132 PGLFNGLISFRAMEBUFFERPROC glIsFramebuffer; 4133 PGLFNGLBINDFRAMEBUFFERPROC glBindFramebuffer; 4134 PGLFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers; 4135 PGLFNGLGENFRAMEBUFFERSPROC glGenFramebuffers; 4136 PGLFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus; 4137 PGLFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D; 4138 PGLFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D; 4139 PGLFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D; 4140 PGLFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer; 4141 PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv; 4142 PGLFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer; 4143 PGLFNGLGENERATEMIPMAPPROC glGenerateMipmap; 4144 }; 4145 3960 4146 #define USE_GL_FUNC(type, pfn, ext, replace) type pfn; 3961 4147 … … 4000 4186 unsigned int ps_glsl_constantsF; 4001 4187 4002 GL_PSVersion ps_arb_version;4003 GL_PSVersion ps_nv_version;4004 4005 GL_VSVersion vs_arb_version;4006 GL_VSVersion vs_nv_version;4007 GL_VSVersion vs_ati_version;4008 4009 4188 DWORD reserved_glsl_constants; 4010 4189 … … 4013 4192 BOOL supported[WINED3D_GL_EXT_COUNT]; 4014 4193 4194 struct wined3d_fbo_ops fbo_ops; 4015 4195 /* GL function pointers */ 4016 4196 GL_EXT_FUNCS_GEN -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_main.c
r22496 r23571 6 6 * Copyright 2004 Jason Edmeades 7 7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers 8 * Copyright 2009 Henri Verbeet for CodeWeavers 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 42 43 void (*CDECL wine_tsx11_unlock_ptr)(void) = NULL; 43 44 45 static CRITICAL_SECTION wined3d_cs; 46 static CRITICAL_SECTION_DEBUG wined3d_cs_debug = 47 { 48 0, 0, &wined3d_cs, 49 {&wined3d_cs_debug.ProcessLocksList, 50 &wined3d_cs_debug.ProcessLocksList}, 51 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs")} 52 }; 53 static CRITICAL_SECTION wined3d_cs = {&wined3d_cs_debug, -1, 0, 0, 0, 0}; 44 54 45 55 /* When updating default value here, make sure to update winecfg as well, 46 56 * where appropriate. */ 47 wined3d_settings_t wined3d_settings = 57 wined3d_settings_t wined3d_settings = 48 58 { 49 59 VS_HW, /* Hardware by default */ 50 60 PS_HW, /* Hardware by default */ 51 VBO_HW, /* Hardware by default */52 61 TRUE, /* Use of GLSL enabled by default */ 53 62 ORM_FBO, /* Use FBOs to do offscreen rendering */ 54 RTL_ AUTO, /* Automatically determine best locking method */63 RTL_READTEX, /* Default render target locking method */ 55 64 PCI_VENDOR_NONE,/* PCI Vendor ID */ 56 65 PCI_DEVICE_NONE,/* PCI Device ID */ … … 206 215 } 207 216 } 208 if ( !get_config_key( hkey, appkey, "VertexBufferMode", buffer, size) )209 {210 if (!strcmp(buffer,"none"))211 {212 TRACE("Disable Vertex Buffer Hardware support\n");213 wined3d_settings.vbo_mode = VBO_NONE;214 }215 else if (!strcmp(buffer,"hardware"))216 {217 TRACE("Allow Vertex Buffer Hardware support\n");218 wined3d_settings.vbo_mode = VBO_HW;219 }220 }221 217 if ( !get_config_key( hkey, appkey, "UseGLSL", buffer, size) ) 222 218 { … … 261 257 TRACE("Using glReadPixels for render target reading and textures for writing\n"); 262 258 wined3d_settings.rendertargetlock_mode = RTL_READTEX; 263 }264 else if (!strcmp(buffer,"texdraw"))265 {266 TRACE("Using textures for render target reading and glDrawPixels for writing\n");267 wined3d_settings.rendertargetlock_mode = RTL_TEXDRAW;268 }269 else if (!strcmp(buffer,"textex"))270 {271 TRACE("Reading render targets via textures and writing via textures\n");272 wined3d_settings.rendertargetlock_mode = RTL_TEXTEX;273 259 } 274 260 } … … 318 304 if ( !get_config_key( hkey, appkey, "WineLogo", buffer, size) ) 319 305 { 320 wined3d_settings.logo = HeapAlloc(GetProcessHeap(), 0, strlen(buffer) + 1); 321 if(wined3d_settings.logo) strcpy(wined3d_settings.logo, buffer); 306 size_t len = strlen(buffer) + 1; 307 308 wined3d_settings.logo = HeapAlloc(GetProcessHeap(), 0, len); 309 if (!wined3d_settings.logo) ERR("Failed to allocate logo path memory.\n"); 310 else memcpy(wined3d_settings.logo, buffer, len); 322 311 } 323 312 if ( !get_config_key( hkey, appkey, "Multisampling", buffer, size) ) … … 334 323 if (wined3d_settings.ps_mode == PS_NONE) 335 324 TRACE("Disable pixel shaders\n"); 336 if (wined3d_settings.vbo_mode == VBO_NONE)337 TRACE("Disable Vertex Buffer Hardware support\n");338 325 if (wined3d_settings.glslRequested) 339 326 TRACE("If supported by your system, GL Shading Language will be used\n"); … … 361 348 } 362 349 350 void WINAPI wined3d_mutex_lock(void) 351 { 352 EnterCriticalSection(&wined3d_cs); 353 } 354 355 void WINAPI wined3d_mutex_unlock(void) 356 { 357 LeaveCriticalSection(&wined3d_cs); 358 } 359 363 360 /* At process attach */ 364 361 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r22496 r23571 143 143 } 144 144 145 void *wined3d_rb_alloc(size_t size) ;146 void *wined3d_rb_realloc(void *ptr, size_t size) ;147 void wined3d_rb_free(void *ptr) ;145 void *wined3d_rb_alloc(size_t size) DECLSPEC_HIDDEN; 146 void *wined3d_rb_realloc(void *ptr, size_t size) DECLSPEC_HIDDEN; 147 void wined3d_rb_free(void *ptr) DECLSPEC_HIDDEN; 148 148 149 149 /* Device caps */ … … 165 165 #define NUM_SAVEDVERTEXSTATES_S 1 166 166 167 extern const DWORD SavedPixelStates_R[NUM_SAVEDPIXELSTATES_R] ;168 extern const DWORD SavedPixelStates_T[NUM_SAVEDPIXELSTATES_T] ;169 extern const DWORD SavedPixelStates_S[NUM_SAVEDPIXELSTATES_S] ;170 extern const DWORD SavedVertexStates_R[NUM_SAVEDVERTEXSTATES_R] ;171 extern const DWORD SavedVertexStates_T[NUM_SAVEDVERTEXSTATES_T] ;172 extern const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] ;167 extern const DWORD SavedPixelStates_R[NUM_SAVEDPIXELSTATES_R] DECLSPEC_HIDDEN; 168 extern const DWORD SavedPixelStates_T[NUM_SAVEDPIXELSTATES_T] DECLSPEC_HIDDEN; 169 extern const DWORD SavedPixelStates_S[NUM_SAVEDPIXELSTATES_S] DECLSPEC_HIDDEN; 170 extern const DWORD SavedVertexStates_R[NUM_SAVEDVERTEXSTATES_R] DECLSPEC_HIDDEN; 171 extern const DWORD SavedVertexStates_T[NUM_SAVEDVERTEXSTATES_T] DECLSPEC_HIDDEN; 172 extern const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] DECLSPEC_HIDDEN; 173 173 174 174 typedef enum _WINELOOKUP { … … 177 177 } WINELOOKUP; 178 178 179 extern const int minLookup[MAX_LOOKUPS] ;180 extern const int maxLookup[MAX_LOOKUPS] ;181 extern DWORD *stateLookup[MAX_LOOKUPS] ;179 extern const int minLookup[MAX_LOOKUPS] DECLSPEC_HIDDEN; 180 extern const int maxLookup[MAX_LOOKUPS] DECLSPEC_HIDDEN; 181 extern DWORD *stateLookup[MAX_LOOKUPS] DECLSPEC_HIDDEN; 182 182 183 183 struct min_lookup … … 186 186 }; 187 187 188 const struct min_lookup minMipLookup[WINED3DTEXF_LINEAR + 1]; 189 const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_LINEAR + 1]; 190 const GLenum magLookup[WINED3DTEXF_LINEAR + 1]; 191 const GLenum magLookup_noFilter[WINED3DTEXF_LINEAR + 1]; 188 const struct min_lookup minMipLookup[WINED3DTEXF_LINEAR + 1] DECLSPEC_HIDDEN; 189 const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_LINEAR + 1] DECLSPEC_HIDDEN; 190 const struct min_lookup minMipLookup_noMip[WINED3DTEXF_LINEAR + 1] DECLSPEC_HIDDEN; 191 const GLenum magLookup[WINED3DTEXF_LINEAR + 1] DECLSPEC_HIDDEN; 192 const GLenum magLookup_noFilter[WINED3DTEXF_LINEAR + 1] DECLSPEC_HIDDEN; 192 193 193 194 static inline GLenum wined3d_gl_mag_filter(const GLenum mag_lookup[], WINED3DTEXTUREFILTERTYPE mag_filter) … … 259 260 260 261 /** 261 * Settings 262 * Settings 262 263 */ 263 264 #define VS_NONE 0 … … 284 285 285 286 #define RTL_DISABLE -1 286 #define RTL_AUTO 0287 287 #define RTL_READDRAW 1 288 288 #define RTL_READTEX 2 289 #define RTL_TEXDRAW 3290 #define RTL_TEXTEX 4291 289 292 290 #define PCI_VENDOR_NONE 0xffff /* e.g. 0x8086 for Intel and 0x10de for Nvidia */ … … 299 297 int vs_mode; 300 298 int ps_mode; 301 int vbo_mode;302 299 /* Ideally, we don't want the user to have to request GLSL. If the hardware supports GLSL, 303 300 we should use it. However, until it's fully implemented, we'll leave it as a registry … … 314 311 } wined3d_settings_t; 315 312 316 extern wined3d_settings_t wined3d_settings ;313 extern wined3d_settings_t wined3d_settings DECLSPEC_HIDDEN; 317 314 318 315 typedef enum _WINED3DSAMPLER_TEXTURE_TYPE … … 648 645 { 649 646 struct wined3d_shader_version shader_version; 650 char texcoord[MAX_REG_TEXCRD]; /* pixel < 3.0*/651 char temporary[MAX_REG_TEMP]; /* pixel, vertex*/652 char address[MAX_REG_ADDR]; /* vertex*/653 char labels[MAX_LABELS]; /* pixel, vertex*/647 BYTE texcoord; /* MAX_REG_TEXCRD, 8 */ 648 BYTE address; /* MAX_REG_ADDR, 1 */ 649 WORD labels; /* MAX_LABELS, 16 */ 650 DWORD temporary; /* MAX_REG_TEMP, 32 */ 654 651 DWORD *constf; /* pixel, vertex */ 655 652 DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */ … … 662 659 663 660 WINED3DSAMPLER_TEXTURE_TYPE sampler_type[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)]; 664 BOOL bumpmat[MAX_TEXTURES], luminanceparams[MAX_TEXTURES]; 665 666 unsigned usesnrm : 1; 667 unsigned vpos : 1; 668 unsigned usesdsx : 1; 669 unsigned usesdsy : 1; 670 unsigned usestexldd : 1; 671 unsigned usesmova : 1; 672 unsigned usesfacing : 1; 673 unsigned usesrelconstF : 1; 674 unsigned fog : 1; 675 unsigned usestexldl : 1; 676 unsigned usesifc : 1; 677 unsigned usescall : 1; 678 unsigned padding : 4; 661 BYTE bumpmat; /* MAX_TEXTURES, 8 */ 662 BYTE luminanceparams; /* MAX_TEXTURES, 8 */ 663 664 WORD usesnrm : 1; 665 WORD vpos : 1; 666 WORD usesdsx : 1; 667 WORD usesdsy : 1; 668 WORD usestexldd : 1; 669 WORD usesmova : 1; 670 WORD usesfacing : 1; 671 WORD usesrelconstF : 1; 672 WORD fog : 1; 673 WORD usestexldl : 1; 674 WORD usesifc : 1; 675 WORD usescall : 1; 676 WORD padding : 4; 679 677 680 678 /* Whether or not loops are used in this shader, and nesting depth */ … … 742 740 WINED3DDECLUSAGE usage; 743 741 UINT usage_idx; 742 }; 743 744 struct wined3d_shader_loop_control 745 { 746 unsigned int count; 747 unsigned int start; 748 int step; 744 749 }; 745 750 … … 759 764 }; 760 765 761 extern const struct wined3d_shader_frontend sm1_shader_frontend ;762 extern const struct wined3d_shader_frontend sm4_shader_frontend ;766 extern const struct wined3d_shader_frontend sm1_shader_frontend DECLSPEC_HIDDEN; 767 extern const struct wined3d_shader_frontend sm4_shader_frontend DECLSPEC_HIDDEN; 763 768 764 769 typedef void (*SHADER_HANDLER)(const struct wined3d_shader_instruction *); … … 854 859 } shader_backend_t; 855 860 856 extern const shader_backend_t glsl_shader_backend ;857 extern const shader_backend_t arb_program_shader_backend ;858 extern const shader_backend_t none_shader_backend ;861 extern const shader_backend_t glsl_shader_backend DECLSPEC_HIDDEN; 862 extern const shader_backend_t arb_program_shader_backend DECLSPEC_HIDDEN; 863 extern const shader_backend_t none_shader_backend DECLSPEC_HIDDEN; 859 864 860 865 /* X11 locking */ 861 866 862 extern void (* CDECL wine_tsx11_lock_ptr)(void) ;863 extern void (* CDECL wine_tsx11_unlock_ptr)(void) ;867 extern void (* CDECL wine_tsx11_lock_ptr)(void) DECLSPEC_HIDDEN; 868 extern void (* CDECL wine_tsx11_unlock_ptr)(void) DECLSPEC_HIDDEN; 864 869 865 870 /* As GLX relies on X, this is needed */ 866 extern int num_lock ;871 extern int num_lock DECLSPEC_HIDDEN; 867 872 868 873 #if 0 … … 954 959 955 960 /* Trace vector and strided data information */ 956 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w); 957 #define TRACE_STRIDED(si, name) TRACE( #name "=(data:%p, stride:%d, format:%#x, vbo %d, stream %u)\n", \ 961 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w) 962 #define TRACE_STRIDED(si, name) do { if (si->use_map & (1 << name)) \ 963 TRACE( #name "=(data:%p, stride:%d, format:%#x, vbo %d, stream %u)\n", \ 958 964 si->elements[name].data, si->elements[name].stride, si->elements[name].format_desc->format, \ 959 si->elements[name].buffer_object, si->elements[name].stream_idx); 965 si->elements[name].buffer_object, si->elements[name].stream_idx); } while(0) 960 966 961 967 /* Defines used for optimizations */ … … 972 978 973 979 /* Global variables */ 974 extern const float identity[16] ;980 extern const float identity[16] DECLSPEC_HIDDEN; 975 981 976 982 /***************************************************************************** … … 981 987 #if 0 /* NOTE: Must be 0 in cvs */ 982 988 # define VTRACE(A) TRACE A 983 #else 984 # define VTRACE(A) 989 #else 990 # define VTRACE(A) 985 991 #endif 986 992 … … 995 1001 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */ 996 1002 # define SINGLE_FRAME_DEBUGGING 997 # endif 1003 # endif 998 1004 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls. 999 It can only be enabled when FRAME_DEBUGGING is also enabled 1000 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive 1005 It can only be enabled when FRAME_DEBUGGING is also enabled 1006 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive 1001 1007 array is drawn. */ 1002 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ 1008 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ 1003 1009 # define SHOW_FRAME_MAKEUP 1 1004 # endif 1010 # endif 1005 1011 /* The following, when enabled, lets you see the makeup of the all the textures used during each 1006 1012 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled. 1007 The contents of the textures assigned to each stage are written into 1013 The contents of the textures assigned to each stage are written into 1008 1014 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */ 1009 1015 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ 1010 1016 # define SHOW_TEXTURE_MAKEUP 0 1011 # endif 1017 # endif 1012 1018 extern BOOL isOn; 1013 1019 extern BOOL isDumpingFrames; … … 1078 1084 1079 1085 /* Routine common to the draw primitive and draw indexed primitive routines */ 1080 void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertices,1081 UINT start_idx, UINT idxBytes, const void *idxData , UINT minIndex);1082 DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) ;1086 void drawPrimitive(IWineD3DDevice *iface, UINT index_count, 1087 UINT start_idx, UINT idxBytes, const void *idxData) DECLSPEC_HIDDEN; 1088 DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; 1083 1089 1084 1090 typedef void (WINE_GLAPI *glAttribFunc)(const void *data); 1085 1091 typedef void (WINE_GLAPI *glMultiTexCoordFunc)(GLenum unit, const void *data); 1086 extern glAttribFunc position_funcs[WINED3D_FFP_EMIT_COUNT] ;1087 extern glAttribFunc diffuse_funcs[WINED3D_FFP_EMIT_COUNT] ;1088 extern glAttribFunc specular_func_3ubv ;1089 extern glAttribFunc specular_funcs[WINED3D_FFP_EMIT_COUNT] ;1090 extern glAttribFunc normal_funcs[WINED3D_FFP_EMIT_COUNT] ;1091 extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT] ;1092 extern glAttribFunc position_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC_HIDDEN; 1093 extern glAttribFunc diffuse_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC_HIDDEN; 1094 extern glAttribFunc specular_func_3ubv DECLSPEC_HIDDEN; 1095 extern glAttribFunc specular_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC_HIDDEN; 1096 extern glAttribFunc normal_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC_HIDDEN; 1097 extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC_HIDDEN; 1092 1098 1093 1099 #define eps 1e-8 … … 1281 1287 }; 1282 1288 1283 extern const struct StateEntryTemplate misc_state_template[] ;1284 extern const struct StateEntryTemplate ffp_vertexstate_template[] ;1285 extern const struct fragment_pipeline ffp_fragment_pipeline ;1286 extern const struct fragment_pipeline atifs_fragment_pipeline ;1287 extern const struct fragment_pipeline arbfp_fragment_pipeline ;1288 extern const struct fragment_pipeline nvts_fragment_pipeline ;1289 extern const struct fragment_pipeline nvrc_fragment_pipeline ;1289 extern const struct StateEntryTemplate misc_state_template[] DECLSPEC_HIDDEN; 1290 extern const struct StateEntryTemplate ffp_vertexstate_template[] DECLSPEC_HIDDEN; 1291 extern const struct fragment_pipeline ffp_fragment_pipeline DECLSPEC_HIDDEN; 1292 extern const struct fragment_pipeline atifs_fragment_pipeline DECLSPEC_HIDDEN; 1293 extern const struct fragment_pipeline arbfp_fragment_pipeline DECLSPEC_HIDDEN; 1294 extern const struct fragment_pipeline nvts_fragment_pipeline DECLSPEC_HIDDEN; 1295 extern const struct fragment_pipeline nvrc_fragment_pipeline DECLSPEC_HIDDEN; 1290 1296 1291 1297 /* "Base" state table */ 1292 1298 HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, 1293 1299 const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex, 1294 const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc) ;1300 const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc) DECLSPEC_HIDDEN; 1295 1301 1296 1302 /* Shaders for color conversions in blits */ … … 1305 1311 }; 1306 1312 1307 extern const struct blit_shader ffp_blit ;1308 extern const struct blit_shader arbfp_blit ;1313 extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN; 1314 extern const struct blit_shader arbfp_blit DECLSPEC_HIDDEN; 1309 1315 1310 1316 typedef enum ContextUsage { … … 1315 1321 } ContextUsage; 1316 1322 1317 struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage); 1323 struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, 1324 IWineD3DSurface *target, enum ContextUsage usage) DECLSPEC_HIDDEN; 1318 1325 struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win, 1319 BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms); 1320 void DestroyContext(IWineD3DDeviceImpl *This, struct wined3d_context *context); 1321 void context_alloc_event_query(struct wined3d_context *context, struct wined3d_event_query *query); 1322 void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query); 1323 void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource, WINED3DRESOURCETYPE type); 1324 void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo); 1326 BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms) DECLSPEC_HIDDEN; 1327 void DestroyContext(IWineD3DDeviceImpl *This, struct wined3d_context *context) DECLSPEC_HIDDEN; 1328 void context_alloc_event_query(struct wined3d_context *context, 1329 struct wined3d_event_query *query) DECLSPEC_HIDDEN; 1330 void context_alloc_occlusion_query(struct wined3d_context *context, 1331 struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; 1332 void context_resource_released(IWineD3DDevice *iface, 1333 IWineD3DResource *resource, WINED3DRESOURCETYPE type) DECLSPEC_HIDDEN; 1334 void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo) DECLSPEC_HIDDEN; 1325 1335 void context_attach_depth_stencil_fbo(struct wined3d_context *context, 1326 GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) ;1336 GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN; 1327 1337 void context_attach_surface_fbo(const struct wined3d_context *context, 1328 GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) ;1329 void context_free_event_query(struct wined3d_event_query *query) ;1330 void context_free_occlusion_query(struct wined3d_occlusion_query *query) ;1331 struct wined3d_context *context_get_current(void) ;1332 DWORD context_get_tls_idx(void) ;1333 BOOL context_set_current(struct wined3d_context *ctx) ;1334 void context_set_tls_idx(DWORD idx) ;1335 1336 void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain) ;1337 HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain) ;1338 GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) DECLSPEC_HIDDEN; 1339 void context_free_event_query(struct wined3d_event_query *query) DECLSPEC_HIDDEN; 1340 void context_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; 1341 struct wined3d_context *context_get_current(void) DECLSPEC_HIDDEN; 1342 DWORD context_get_tls_idx(void) DECLSPEC_HIDDEN; 1343 BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN; 1344 void context_set_tls_idx(DWORD idx) DECLSPEC_HIDDEN; 1345 1346 void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain) DECLSPEC_HIDDEN; 1347 HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain) DECLSPEC_HIDDEN; 1338 1348 1339 1349 /* Macros for doing basic GPU detection based on opengl capabilities */ … … 1344 1354 1345 1355 /* Default callbacks for implicit object destruction */ 1346 extern ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface); 1347 1348 extern ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pSurface); 1356 extern ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pSurface) DECLSPEC_HIDDEN; 1349 1357 1350 1358 /***************************************************************************** … … 1370 1378 1371 1379 /* The default light parameters */ 1372 extern const WINED3DLIGHT WINED3D_default_light ;1380 extern const WINED3DLIGHT WINED3D_default_light DECLSPEC_HIDDEN; 1373 1381 1374 1382 typedef struct WineD3D_PixelFormat … … 1402 1410 }; 1403 1411 1404 extern BOOL initPixelFormats(struct wined3d_gl_info *gl_info) ;1405 BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) ;1406 extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram) ;1407 extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) ;1412 extern BOOL initPixelFormats(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 1413 BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 1414 extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram) DECLSPEC_HIDDEN; 1415 extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 1408 1416 1409 1417 /***************************************************************************** … … 1421 1429 }; 1422 1430 1423 HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, struct WineD3DRectPatch *patch) ;1431 HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, struct WineD3DRectPatch *patch) DECLSPEC_HIDDEN; 1424 1432 1425 1433 enum projection_types … … 1474 1482 }; 1475 1483 1476 extern const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions; 1477 1478 void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype); 1484 extern const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions DECLSPEC_HIDDEN; 1485 extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN; 1486 1487 void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, 1488 BOOL ignore_textype) DECLSPEC_HIDDEN; 1479 1489 const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, 1480 const struct ffp_frag_settings *settings) ;1481 void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *desc) ;1490 const struct ffp_frag_settings *settings) DECLSPEC_HIDDEN; 1491 void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *desc) DECLSPEC_HIDDEN; 1482 1492 1483 1493 /***************************************************************************** … … 1498 1508 } IWineD3DImpl; 1499 1509 1500 extern const IWineD3DVtbl IWineD3D_Vtbl ;1501 1502 BOOL InitAdapters(IWineD3DImpl *This) ;1510 extern const IWineD3DVtbl IWineD3D_Vtbl DECLSPEC_HIDDEN; 1511 1512 BOOL InitAdapters(IWineD3DImpl *This) DECLSPEC_HIDDEN; 1503 1513 1504 1514 /* A helper function that dumps a resource list */ 1505 void dumpResources(struct list *list) ;1515 void dumpResources(struct list *list) DECLSPEC_HIDDEN; 1506 1516 1507 1517 /***************************************************************************** … … 1650 1660 }; 1651 1661 1652 extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl ;1653 1654 void device_resource_add(IWineD3DDeviceImpl *This, IWineD3DResource *resource) ;1655 void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resource) ;1662 extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl DECLSPEC_HIDDEN; 1663 1664 void device_resource_add(IWineD3DDeviceImpl *This, IWineD3DResource *resource) DECLSPEC_HIDDEN; 1665 void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resource) DECLSPEC_HIDDEN; 1656 1666 void device_stream_info_from_declaration(IWineD3DDeviceImpl *This, 1657 BOOL use_vshader, struct wined3d_stream_info *stream_info, BOOL *fixup) ;1667 BOOL use_vshader, struct wined3d_stream_info *stream_info, BOOL *fixup) DECLSPEC_HIDDEN; 1658 1668 void device_stream_info_from_strided(IWineD3DDeviceImpl *This, 1659 const struct WineDirect3DVertexStridedData *strided, struct wined3d_stream_info *stream_info); 1660 HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, DWORD Count, 1661 CONST WINED3DRECT* pRects, DWORD Flags, WINED3DCOLOR Color, 1662 float Z, DWORD Stencil); 1663 void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This); 1664 void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state); 1669 const struct WineDirect3DVertexStridedData *strided, struct wined3d_stream_info *stream_info) DECLSPEC_HIDDEN; 1670 HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, DWORD Count, 1671 const WINED3DRECT *pRects, DWORD Flags, WINED3DCOLOR Color, float Z, DWORD Stencil) DECLSPEC_HIDDEN; 1672 void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This) DECLSPEC_HIDDEN; 1673 void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) DECLSPEC_HIDDEN; 1665 1674 static inline BOOL isStateDirty(struct wined3d_context *context, DWORD state) 1666 1675 { … … 1708 1717 struct list privateData; 1709 1718 struct list resource_list_entry; 1710 1719 const struct wined3d_parent_ops *parent_ops; 1711 1720 } IWineD3DResourceClass; 1712 1721 … … 1718 1727 } IWineD3DResourceImpl; 1719 1728 1720 void resource_cleanup(IWineD3DResource *iface) ;1721 HRESULT resource_free_private_data(IWineD3DResource *iface, REFGUID guid) ;1722 HRESULT resource_get_device(IWineD3DResource *iface, IWineD3DDevice **device) ;1723 HRESULT resource_get_parent(IWineD3DResource *iface, IUnknown **parent) ;1724 DWORD resource_get_priority(IWineD3DResource *iface) ;1729 void resource_cleanup(IWineD3DResource *iface) DECLSPEC_HIDDEN; 1730 HRESULT resource_free_private_data(IWineD3DResource *iface, REFGUID guid) DECLSPEC_HIDDEN; 1731 HRESULT resource_get_device(IWineD3DResource *iface, IWineD3DDevice **device) DECLSPEC_HIDDEN; 1732 HRESULT resource_get_parent(IWineD3DResource *iface, IUnknown **parent) DECLSPEC_HIDDEN; 1733 DWORD resource_get_priority(IWineD3DResource *iface) DECLSPEC_HIDDEN; 1725 1734 HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID guid, 1726 void *data, DWORD *data_size) ;1735 void *data, DWORD *data_size) DECLSPEC_HIDDEN; 1727 1736 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 1728 1737 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc, 1729 WINED3DPOOL pool, IUnknown *parent );1730 WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) ;1731 DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) ;1738 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1739 WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) DECLSPEC_HIDDEN; 1740 DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) DECLSPEC_HIDDEN; 1732 1741 HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID guid, 1733 const void *data, DWORD data_size, DWORD flags) ;1742 const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; 1734 1743 1735 1744 /* Tests show that the start address of resources is 32 byte aligned */ … … 1765 1774 }; 1766 1775 1776 struct gl_texture 1777 { 1778 DWORD states[MAX_WINETEXTURESTATES]; 1779 BOOL dirty; 1780 GLuint name; 1781 }; 1782 1767 1783 /***************************************************************************** 1768 1784 * IWineD3DBaseTexture implementation structure (extends IWineD3DResourceImpl) … … 1770 1786 typedef struct IWineD3DBaseTextureClass 1771 1787 { 1772 DWORD states[MAX_WINETEXTURESTATES]; 1773 DWORD srgbstates[MAX_WINETEXTURESTATES]; 1788 struct gl_texture texture_rgb, texture_srgb; 1774 1789 UINT levels; 1775 BOOL dirty, srgbDirty;1776 UINT textureName, srgbTextureName;1777 1790 float pow2Matrix[16]; 1778 1791 UINT LOD; … … 1787 1800 } IWineD3DBaseTextureClass; 1788 1801 1789 void surface_internal_preload(IWineD3DSurface *iface, enum WINED3DSRGB srgb) ;1802 void surface_internal_preload(IWineD3DSurface *iface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN; 1790 1803 1791 1804 typedef struct IWineD3DBaseTextureImpl … … 1800 1813 void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, 1801 1814 const DWORD texture_states[WINED3D_HIGHEST_TEXTURE_STATE + 1], 1802 const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]) ;1803 HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surface_desc) ;1804 void basetexture_cleanup(IWineD3DBaseTexture *iface) ;1805 void basetexture_generate_mipmaps(IWineD3DBaseTexture *iface) ;1806 WINED3DTEXTUREFILTERTYPE basetexture_get_autogen_filter_type(IWineD3DBaseTexture *iface) ;1807 BOOL basetexture_get_dirty(IWineD3DBaseTexture *iface) ;1808 DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface) ;1809 DWORD basetexture_get_lod(IWineD3DBaseTexture *iface) ;1815 const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]) DECLSPEC_HIDDEN; 1816 HRESULT basetexture_bind(IWineD3DBaseTexture *iface, BOOL srgb, BOOL *set_surface_desc) DECLSPEC_HIDDEN; 1817 void basetexture_cleanup(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1818 void basetexture_generate_mipmaps(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1819 WINED3DTEXTUREFILTERTYPE basetexture_get_autogen_filter_type(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1820 BOOL basetexture_get_dirty(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1821 DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1822 DWORD basetexture_get_lod(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1810 1823 HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DRESOURCETYPE resource_type, 1811 1824 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct GlPixelFormatDesc *format_desc, 1812 WINED3DPOOL pool, IUnknown *parent); 1813 HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE filter_type); 1814 BOOL basetexture_set_dirty(IWineD3DBaseTexture *iface, BOOL dirty); 1815 DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod); 1816 void basetexture_unload(IWineD3DBaseTexture *iface); 1825 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1826 HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, 1827 WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; 1828 BOOL basetexture_set_dirty(IWineD3DBaseTexture *iface, BOOL dirty) DECLSPEC_HIDDEN; 1829 DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod) DECLSPEC_HIDDEN; 1830 void basetexture_unload(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; 1817 1831 1818 1832 /***************************************************************************** … … 1833 1847 } IWineD3DTextureImpl; 1834 1848 1835 extern const IWineD3DTextureVtbl IWineD3DTexture_Vtbl;1836 1837 1849 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 1838 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent); 1850 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 1851 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1839 1852 1840 1853 /***************************************************************************** … … 1852 1865 } IWineD3DCubeTextureImpl; 1853 1866 1854 extern const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl;1855 1856 1867 HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels, 1857 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent); 1868 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 1869 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1858 1870 1859 1871 typedef struct _WINED3DVOLUMET_DESC … … 1883 1895 } IWineD3DVolumeImpl; 1884 1896 1885 extern const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl; 1886 1887 void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box); 1897 void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN; 1898 HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width, 1899 UINT height, UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 1900 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1888 1901 1889 1902 /***************************************************************************** … … 1901 1914 } IWineD3DVolumeTextureImpl; 1902 1915 1903 extern const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl; 1904 1905 HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, UINT depth, UINT levels, 1906 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, IUnknown *parent); 1916 HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height, 1917 UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 1918 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1907 1919 1908 1920 typedef struct _WINED3DSURFACET_DESC … … 2020 2032 }; 2021 2033 2022 extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl; 2023 extern const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl; 2024 2025 UINT surface_calculate_size(const struct GlPixelFormatDesc *format_desc, UINT alignment, UINT width, UINT height); 2026 void surface_gdi_cleanup(IWineD3DSurfaceImpl *This); 2034 extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl DECLSPEC_HIDDEN; 2035 extern const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl DECLSPEC_HIDDEN; 2036 2037 UINT surface_calculate_size(const struct GlPixelFormatDesc *format_desc, 2038 UINT alignment, UINT width, UINT height) DECLSPEC_HIDDEN; 2039 void surface_gdi_cleanup(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN; 2027 2040 HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment, 2028 2041 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 2029 2042 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 2030 WINED3DPOOL pool, IUnknown *parent );2043 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2031 2044 2032 2045 /* Predeclare the shared Surface functions */ 2033 HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj); 2034 ULONG WINAPI IWineD3DBaseSurfaceImpl_AddRef(IWineD3DSurface *iface); 2035 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent); 2036 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDevice(IWineD3DSurface *iface, IWineD3DDevice** ppDevice); 2037 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPrivateData(IWineD3DSurface *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); 2038 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPrivateData(IWineD3DSurface *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData); 2039 HRESULT WINAPI IWineD3DBaseSurfaceImpl_FreePrivateData(IWineD3DSurface *iface, REFGUID refguid); 2040 DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD PriorityNew); 2041 DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface); 2042 WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface); 2043 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetContainer(IWineD3DSurface* iface, REFIID riid, void** ppContainer); 2044 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFACE_DESC *pDesc); 2045 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD Flags); 2046 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD Flags); 2047 HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface); 2048 HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface); 2049 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal); 2050 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal); 2051 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, const WINEDDCOLORKEY *CKey); 2052 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3DBase *container); 2053 DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface); 2054 HRESULT WINAPI IWineD3DBaseSurfaceImpl_RealizePalette(IWineD3DSurface *iface); 2055 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LONG X, LONG Y); 2056 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LONG *X, LONG *Y); 2057 HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, DWORD Flags, IWineD3DSurface *Ref); 2046 HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface, 2047 REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; 2048 ULONG WINAPI IWineD3DBaseSurfaceImpl_AddRef(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2049 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) DECLSPEC_HIDDEN; 2050 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDevice(IWineD3DSurface *iface, IWineD3DDevice** ppDevice) DECLSPEC_HIDDEN; 2051 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPrivateData(IWineD3DSurface *iface, 2052 REFGUID refguid, const void *pData, DWORD SizeOfData, DWORD Flags) DECLSPEC_HIDDEN; 2053 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPrivateData(IWineD3DSurface *iface, 2054 REFGUID refguid, void *pData, DWORD *pSizeOfData) DECLSPEC_HIDDEN; 2055 HRESULT WINAPI IWineD3DBaseSurfaceImpl_FreePrivateData(IWineD3DSurface *iface, REFGUID refguid) DECLSPEC_HIDDEN; 2056 DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD PriorityNew) DECLSPEC_HIDDEN; 2057 DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2058 WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2059 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetContainer(IWineD3DSurface* iface, 2060 REFIID riid, void **ppContainer) DECLSPEC_HIDDEN; 2061 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFACE_DESC *pDesc) DECLSPEC_HIDDEN; 2062 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD Flags) DECLSPEC_HIDDEN; 2063 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD Flags) DECLSPEC_HIDDEN; 2064 HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2065 HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2066 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal) DECLSPEC_HIDDEN; 2067 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal) DECLSPEC_HIDDEN; 2068 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, 2069 DWORD Flags, const WINEDDCOLORKEY *CKey) DECLSPEC_HIDDEN; 2070 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3DBase *container) DECLSPEC_HIDDEN; 2071 DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2072 HRESULT WINAPI IWineD3DBaseSurfaceImpl_RealizePalette(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2073 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LONG X, LONG Y) DECLSPEC_HIDDEN; 2074 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LONG *X, LONG *Y) DECLSPEC_HIDDEN; 2075 HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, 2076 DWORD Flags, IWineD3DSurface *Ref) DECLSPEC_HIDDEN; 2058 2077 HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, const RECT *SrcRect, 2059 IWineD3DSurface *DstSurface, const RECT *DstRect, DWORD Flags, const WINEDDOVERLAYFX *FX) ;2060 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper) ;2061 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper) ;2062 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) ;2063 HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) ;2078 IWineD3DSurface *DstSurface, const RECT *DstRect, DWORD Flags, const WINEDDOVERLAYFX *FX) DECLSPEC_HIDDEN; 2079 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper) DECLSPEC_HIDDEN; 2080 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper) DECLSPEC_HIDDEN; 2081 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) DECLSPEC_HIDDEN; 2082 HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2064 2083 HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *DestRect, IWineD3DSurface *SrcSurface, 2065 const RECT *SrcRect, DWORD Flags, const WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) ;2084 const RECT *SrcRect, DWORD Flags, const WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) DECLSPEC_HIDDEN; 2066 2085 HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, 2067 IWineD3DSurface *Source, const RECT *rsrc, DWORD trans); 2068 HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags); 2069 void WINAPI IWineD3DBaseSurfaceImpl_BindTexture(IWineD3DSurface *iface, BOOL srgb); 2070 const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface); 2071 2072 void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height); 2073 void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height); 2074 void get_drawable_size_pbuffer(struct wined3d_context *context, UINT *width, UINT *height); 2075 void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height); 2076 2077 void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back); 2086 IWineD3DSurface *Source, const RECT *rsrc, DWORD trans) DECLSPEC_HIDDEN; 2087 HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT *pLockedRect, 2088 const RECT *pRect, DWORD Flags) DECLSPEC_HIDDEN; 2089 void WINAPI IWineD3DBaseSurfaceImpl_BindTexture(IWineD3DSurface *iface, BOOL srgb) DECLSPEC_HIDDEN; 2090 const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface) DECLSPEC_HIDDEN; 2091 2092 void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; 2093 void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; 2094 void get_drawable_size_pbuffer(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; 2095 void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; 2096 2097 void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) DECLSPEC_HIDDEN; 2078 2098 2079 2099 /* Surface flags: */ … … 2131 2151 #define SFLAG_DS_DISCARDED SFLAG_DS_LOCATIONS 2132 2152 2133 BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4]) ;2153 BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4]) DECLSPEC_HIDDEN; 2134 2154 2135 2155 typedef enum { … … 2161 2181 } CONVERT_TYPES; 2162 2182 2163 HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode); 2164 2165 BOOL palette9_changed(IWineD3DSurfaceImpl *This); 2183 HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, 2184 GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode) DECLSPEC_HIDDEN; 2185 2186 BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN; 2166 2187 2167 2188 /***************************************************************************** … … 2188 2209 2189 2210 IUnknown *parent; 2211 const struct wined3d_parent_ops *parent_ops; 2190 2212 IWineD3DDeviceImpl *wineD3DDevice; 2191 2213 … … 2199 2221 } IWineD3DVertexDeclarationImpl; 2200 2222 2201 extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl; 2202 2203 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This, 2204 const WINED3DVERTEXELEMENT *elements, UINT element_count); 2223 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device, 2224 const WINED3DVERTEXELEMENT *elements, UINT element_count, 2225 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2205 2226 2206 2227 /***************************************************************************** … … 2348 2369 }; 2349 2370 2350 extern void stateblock_savedstates_set( 2351 IWineD3DStateBlock* iface, 2352 SAVEDSTATES* states, 2353 BOOL value); 2354 2355 extern void stateblock_copy( 2356 IWineD3DStateBlock* destination, 2357 IWineD3DStateBlock* source); 2358 2359 extern const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl; 2371 extern void stateblock_savedstates_set(IWineD3DStateBlock *iface, SAVEDSTATES *states, BOOL value) DECLSPEC_HIDDEN; 2372 extern void stateblock_copy(IWineD3DStateBlock *destination, IWineD3DStateBlock *source) DECLSPEC_HIDDEN; 2373 2374 extern const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl DECLSPEC_HIDDEN; 2360 2375 2361 2376 /* Direct3D terminology with little modifications. We do not have an issued state … … 2375 2390 const IWineD3DQueryVtbl *lpVtbl; 2376 2391 LONG ref; /* Note: Ref counting not required */ 2377 2392 2378 2393 IUnknown *parent; 2379 2394 /*TODO: replace with iface usage */ … … 2389 2404 /* TODO: Think about using a IUnknown instead of a void* */ 2390 2405 void *extendedData; 2391 2392 2393 2406 } IWineD3DQueryImpl; 2394 2407 2395 extern const IWineD3DQueryVtbl IWineD3DQuery_Vtbl ;2396 extern const IWineD3DQueryVtbl IWineD3DEventQuery_Vtbl ;2397 extern const IWineD3DQueryVtbl IWineD3DOcclusionQuery_Vtbl ;2408 extern const IWineD3DQueryVtbl IWineD3DQuery_Vtbl DECLSPEC_HIDDEN; 2409 extern const IWineD3DQueryVtbl IWineD3DEventQuery_Vtbl DECLSPEC_HIDDEN; 2410 extern const IWineD3DQueryVtbl IWineD3DOcclusionQuery_Vtbl DECLSPEC_HIDDEN; 2398 2411 2399 2412 /* IWineD3DBuffer */ … … 2443 2456 }; 2444 2457 2445 extern const IWineD3DBufferVtbl wined3d_buffer_vtbl; 2446 const BYTE *buffer_get_memory(IWineD3DBuffer *iface, UINT offset, GLuint *buffer_object); 2447 BYTE *buffer_get_sysmem(struct wined3d_buffer *This); 2458 const BYTE *buffer_get_memory(IWineD3DBuffer *iface, UINT offset, GLuint *buffer_object) DECLSPEC_HIDDEN; 2459 BYTE *buffer_get_sysmem(struct wined3d_buffer *This) DECLSPEC_HIDDEN; 2460 HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, 2461 UINT size, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, GLenum bind_hint, 2462 const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2448 2463 2449 2464 /* IWineD3DRendertargetView */ … … 2457 2472 }; 2458 2473 2459 extern const IWineD3DRendertargetViewVtbl wined3d_rendertarget_view_vtbl ;2474 extern const IWineD3DRendertargetViewVtbl wined3d_rendertarget_view_vtbl DECLSPEC_HIDDEN; 2460 2475 2461 2476 /***************************************************************************** … … 2489 2504 } IWineD3DSwapChainImpl; 2490 2505 2491 extern const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl; 2492 const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl; 2493 void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc); 2494 2495 HRESULT WINAPI IWineD3DBaseSwapChainImpl_QueryInterface(IWineD3DSwapChain *iface, REFIID riid, LPVOID *ppobj); 2496 ULONG WINAPI IWineD3DBaseSwapChainImpl_AddRef(IWineD3DSwapChain *iface); 2497 ULONG WINAPI IWineD3DBaseSwapChainImpl_Release(IWineD3DSwapChain *iface); 2498 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetParent(IWineD3DSwapChain *iface, IUnknown ** ppParent); 2499 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetFrontBufferData(IWineD3DSwapChain *iface, IWineD3DSurface *pDestSurface); 2500 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetBackBuffer(IWineD3DSwapChain *iface, UINT iBackBuffer, WINED3DBACKBUFFER_TYPE Type, IWineD3DSurface **ppBackBuffer); 2501 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetRasterStatus(IWineD3DSwapChain *iface, WINED3DRASTER_STATUS *pRasterStatus); 2502 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface, WINED3DDISPLAYMODE*pMode); 2503 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDevice(IWineD3DSwapChain *iface, IWineD3DDevice**ppDevice); 2504 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetPresentParameters(IWineD3DSwapChain *iface, WINED3DPRESENT_PARAMETERS *pPresentationParameters); 2505 HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface, DWORD Flags, CONST WINED3DGAMMARAMP *pRamp); 2506 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, WINED3DGAMMARAMP *pRamp); 2507 2508 struct wined3d_context *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface); 2506 extern const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl DECLSPEC_HIDDEN; 2507 const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl DECLSPEC_HIDDEN; 2508 void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc) DECLSPEC_HIDDEN; 2509 2510 HRESULT WINAPI IWineD3DBaseSwapChainImpl_QueryInterface(IWineD3DSwapChain *iface, 2511 REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; 2512 ULONG WINAPI IWineD3DBaseSwapChainImpl_AddRef(IWineD3DSwapChain *iface) DECLSPEC_HIDDEN; 2513 ULONG WINAPI IWineD3DBaseSwapChainImpl_Release(IWineD3DSwapChain *iface) DECLSPEC_HIDDEN; 2514 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetParent(IWineD3DSwapChain *iface, IUnknown **ppParent) DECLSPEC_HIDDEN; 2515 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetFrontBufferData(IWineD3DSwapChain *iface, 2516 IWineD3DSurface *pDestSurface) DECLSPEC_HIDDEN; 2517 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetBackBuffer(IWineD3DSwapChain *iface, UINT iBackBuffer, 2518 WINED3DBACKBUFFER_TYPE Type, IWineD3DSurface **ppBackBuffer) DECLSPEC_HIDDEN; 2519 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetRasterStatus(IWineD3DSwapChain *iface, 2520 WINED3DRASTER_STATUS *pRasterStatus) DECLSPEC_HIDDEN; 2521 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface, 2522 WINED3DDISPLAYMODE *pMode) DECLSPEC_HIDDEN; 2523 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDevice(IWineD3DSwapChain *iface, 2524 IWineD3DDevice **ppDevice) DECLSPEC_HIDDEN; 2525 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetPresentParameters(IWineD3DSwapChain *iface, 2526 WINED3DPRESENT_PARAMETERS *pPresentationParameters) DECLSPEC_HIDDEN; 2527 HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface, 2528 DWORD Flags, const WINED3DGAMMARAMP *pRamp) DECLSPEC_HIDDEN; 2529 HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, 2530 WINED3DGAMMARAMP *pRamp) DECLSPEC_HIDDEN; 2531 2532 struct wined3d_context *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface) DECLSPEC_HIDDEN; 2533 2534 #define DEFAULT_REFRESH_RATE 0 2509 2535 2510 2536 /***************************************************************************** 2511 * Utility function prototypes 2537 * Utility function prototypes 2512 2538 */ 2513 2539 2514 2540 /* Trace routines */ 2515 const char * debug_d3dformat(WINED3DFORMAT fmt);2516 const char * debug_d3ddevicetype(WINED3DDEVTYPE devtype);2517 const char * debug_d3dresourcetype(WINED3DRESOURCETYPE res);2518 const char * debug_d3dusage(DWORD usage);2519 const char * debug_d3dusagequery(DWORD usagequery);2520 const char * debug_d3ddeclmethod(WINED3DDECLMETHOD method);2521 const char * debug_d3ddeclusage(BYTE usage);2522 const char * debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType);2523 const char * debug_d3drenderstate(DWORD state);2524 const char * debug_d3dsamplerstate(DWORD state);2525 const char * debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type);2526 const char * debug_d3dtexturestate(DWORD state);2527 const char * debug_d3dtstype(WINED3DTRANSFORMSTATETYPE tstype);2528 const char * debug_d3dpool(WINED3DPOOL pool);2529 const char *debug_fbostatus(GLenum status) ;2530 const char *debug_glerror(GLenum error) ;2531 const char *debug_d3dbasis(WINED3DBASISTYPE basis) ;2532 const char *debug_d3ddegree(WINED3DDEGREETYPE order) ;2533 const char * debug_d3dtop(WINED3DTEXTUREOP d3dtop);2534 void dump_color_fixup_desc(struct color_fixup_desc fixup) ;2535 const char *debug_surflocation(DWORD flag) ;2541 const char *debug_d3dformat(WINED3DFORMAT fmt) DECLSPEC_HIDDEN; 2542 const char *debug_d3ddevicetype(WINED3DDEVTYPE devtype) DECLSPEC_HIDDEN; 2543 const char *debug_d3dresourcetype(WINED3DRESOURCETYPE res) DECLSPEC_HIDDEN; 2544 const char *debug_d3dusage(DWORD usage) DECLSPEC_HIDDEN; 2545 const char *debug_d3dusagequery(DWORD usagequery) DECLSPEC_HIDDEN; 2546 const char *debug_d3ddeclmethod(WINED3DDECLMETHOD method) DECLSPEC_HIDDEN; 2547 const char *debug_d3ddeclusage(BYTE usage) DECLSPEC_HIDDEN; 2548 const char *debug_d3dprimitivetype(WINED3DPRIMITIVETYPE PrimitiveType) DECLSPEC_HIDDEN; 2549 const char *debug_d3drenderstate(DWORD state) DECLSPEC_HIDDEN; 2550 const char *debug_d3dsamplerstate(DWORD state) DECLSPEC_HIDDEN; 2551 const char *debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; 2552 const char *debug_d3dtexturestate(DWORD state) DECLSPEC_HIDDEN; 2553 const char *debug_d3dtstype(WINED3DTRANSFORMSTATETYPE tstype) DECLSPEC_HIDDEN; 2554 const char *debug_d3dpool(WINED3DPOOL pool) DECLSPEC_HIDDEN; 2555 const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN; 2556 const char *debug_glerror(GLenum error) DECLSPEC_HIDDEN; 2557 const char *debug_d3dbasis(WINED3DBASISTYPE basis) DECLSPEC_HIDDEN; 2558 const char *debug_d3ddegree(WINED3DDEGREETYPE order) DECLSPEC_HIDDEN; 2559 const char *debug_d3dtop(WINED3DTEXTUREOP d3dtop) DECLSPEC_HIDDEN; 2560 void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN; 2561 const char *debug_surflocation(DWORD flag) DECLSPEC_HIDDEN; 2536 2562 2537 2563 /* Routines for GL <-> D3D values */ 2538 GLenum StencilOp(DWORD op); 2539 GLenum CompareFunc(DWORD func); 2540 BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3); 2541 void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst); 2542 void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed, DWORD coordtype, BOOL ffp_can_disable_proj); 2543 void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2544 void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2545 void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2546 void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2547 void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2548 void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2549 void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2550 void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context); 2551 2552 void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect); 2553 GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain); 2554 void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *context, DWORD location); 2555 void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location); 2556 void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height); 2557 void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name); 2558 void surface_set_texture_target(IWineD3DSurface *iface, GLenum target); 2564 GLenum StencilOp(DWORD op) DECLSPEC_HIDDEN; 2565 GLenum CompareFunc(DWORD func) DECLSPEC_HIDDEN; 2566 BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op, 2567 DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN; 2568 void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, 2569 DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst) DECLSPEC_HIDDEN; 2570 void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, 2571 BOOL transformed, DWORD coordtype, BOOL ffp_can_disable_proj) DECLSPEC_HIDDEN; 2572 void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, 2573 struct wined3d_context *context) DECLSPEC_HIDDEN; 2574 void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, 2575 struct wined3d_context *context) DECLSPEC_HIDDEN; 2576 void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, 2577 struct wined3d_context *context) DECLSPEC_HIDDEN; 2578 void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, 2579 struct wined3d_context *context) DECLSPEC_HIDDEN; 2580 void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, 2581 struct wined3d_context *context) DECLSPEC_HIDDEN; 2582 void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, 2583 struct wined3d_context *context) DECLSPEC_HIDDEN; 2584 void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, 2585 struct wined3d_context *context) DECLSPEC_HIDDEN; 2586 void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, 2587 struct wined3d_context *context) DECLSPEC_HIDDEN; 2588 2589 void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect) DECLSPEC_HIDDEN; 2590 GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain) DECLSPEC_HIDDEN; 2591 void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; 2592 void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) DECLSPEC_HIDDEN; 2593 void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, 2594 unsigned int width, unsigned int height) DECLSPEC_HIDDEN; 2595 void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN; 2596 void surface_set_texture_target(IWineD3DSurface *iface, GLenum target) DECLSPEC_HIDDEN; 2559 2597 2560 2598 BOOL getColorBits(const struct GlPixelFormatDesc *format_desc, 2561 short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize); 2562 BOOL getDepthStencilBits(const struct GlPixelFormatDesc *format_desc, short *depthSize, short *stencilSize); 2599 short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) DECLSPEC_HIDDEN; 2600 BOOL getDepthStencilBits(const struct GlPixelFormatDesc *format_desc, 2601 short *depthSize, short *stencilSize) DECLSPEC_HIDDEN; 2563 2602 2564 2603 /* Math utils */ 2565 void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2) ;2566 UINT wined3d_log2i(UINT32 x) ;2567 unsigned int count_bits(unsigned int mask) ;2604 void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2) DECLSPEC_HIDDEN; 2605 UINT wined3d_log2i(UINT32 x) DECLSPEC_HIDDEN; 2606 unsigned int count_bits(unsigned int mask) DECLSPEC_HIDDEN; 2568 2607 2569 2608 typedef struct local_constant { … … 2587 2626 } SHADER_LIMITS; 2588 2627 2589 /* * Keeps track of details for TEX_M#x# shader opcodes which need to2590 2628 /* Keeps track of details for TEX_M#x# shader opcodes which need to 2629 * maintain state information between multiple codes */ 2591 2630 typedef struct SHADER_PARSE_STATE { 2592 2631 unsigned int current_row; … … 2601 2640 2602 2641 /* Base Shader utility functions. */ 2603 int shader_addline(struct wined3d_shader_buffer *buffer, const char *fmt, ...) PRINTF_ATTR(2,3) ;2604 int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *fmt, va_list args) ;2642 int shader_addline(struct wined3d_shader_buffer *buffer, const char *fmt, ...) PRINTF_ATTR(2,3) DECLSPEC_HIDDEN; 2643 int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *fmt, va_list args) DECLSPEC_HIDDEN; 2605 2644 2606 2645 /* Vertex shader utility functions */ 2607 extern BOOL vshader_get_input( 2608 IWineD3DVertexShader* iface, 2609 BYTE usage_req, BYTE usage_idx_req, 2610 unsigned int* regnum); 2611 2612 extern HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object); 2646 extern BOOL vshader_get_input(IWineD3DVertexShader *iface, 2647 BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum) DECLSPEC_HIDDEN; 2648 2649 extern HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) DECLSPEC_HIDDEN; 2613 2650 2614 2651 /***************************************************************************** … … 2626 2663 const struct wined3d_shader_frontend *frontend; 2627 2664 void *frontend_data; 2665 void *backend_data; 2666 2667 IUnknown *parent; 2668 const struct wined3d_parent_ops *parent_ops; 2628 2669 2629 2670 /* Programs this shader is linked with */ … … 2650 2691 } IWineD3DBaseShaderImpl; 2651 2692 2652 void shader_buffer_clear(struct wined3d_shader_buffer *buffer) ;2653 BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer) ;2654 void shader_buffer_free(struct wined3d_shader_buffer *buffer) ;2655 void shader_cleanup(IWineD3DBaseShader *iface) ;2693 void shader_buffer_clear(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN; 2694 BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN; 2695 void shader_buffer_free(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN; 2696 void shader_cleanup(IWineD3DBaseShader *iface) DECLSPEC_HIDDEN; 2656 2697 void shader_dump_src_param(const struct wined3d_shader_src_param *param, 2657 const struct wined3d_shader_version *shader_version) ;2698 const struct wined3d_shader_version *shader_version) DECLSPEC_HIDDEN; 2658 2699 void shader_dump_dst_param(const struct wined3d_shader_dst_param *param, 2659 const struct wined3d_shader_version *shader_version); 2700 const struct wined3d_shader_version *shader_version) DECLSPEC_HIDDEN; 2701 unsigned int shader_find_free_input_register(const struct shader_reg_maps *reg_maps, unsigned int max) DECLSPEC_HIDDEN; 2660 2702 void shader_generate_main(IWineD3DBaseShader *iface, struct wined3d_shader_buffer *buffer, 2661 const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx) ;2703 const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx) DECLSPEC_HIDDEN; 2662 2704 HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3d_shader_frontend *fe, 2663 2705 struct shader_reg_maps *reg_maps, struct wined3d_shader_attribute *attributes, 2664 2706 struct wined3d_shader_signature_element *input_signature, 2665 struct wined3d_shader_signature_element *output_signature, const DWORD *byte_code, DWORD constf_size); 2666 void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDevice *device); 2667 BOOL shader_match_semantic(const char *semantic_name, WINED3DDECLUSAGE usage); 2668 const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token); 2669 void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data, const DWORD *pFunction); 2707 struct wined3d_shader_signature_element *output_signature, 2708 const DWORD *byte_code, DWORD constf_size) DECLSPEC_HIDDEN; 2709 void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDeviceImpl *device, 2710 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2711 BOOL shader_match_semantic(const char *semantic_name, WINED3DDECLUSAGE usage) DECLSPEC_HIDDEN; 2712 const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token) DECLSPEC_HIDDEN; 2713 void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data, const DWORD *pFunction) DECLSPEC_HIDDEN; 2670 2714 2671 2715 static inline BOOL shader_is_pshader_version(enum wined3d_shader_type type) … … 2735 2779 */ 2736 2780 typedef struct IWineD3DVertexShaderImpl { 2737 /* IUnknown parts */2781 /* IUnknown parts */ 2738 2782 const IWineD3DVertexShaderVtbl *lpVtbl; 2739 2783 2740 2784 /* IWineD3DBaseShader */ 2741 2785 IWineD3DBaseShaderClass baseShader; 2742 2743 /* IWineD3DVertexShaderImpl */2744 IUnknown *parent;2745 2746 DWORD usage;2747 2748 /* The GL shader */2749 void *backend_priv;2750 2786 2751 2787 /* Vertex shader input and output semantics */ … … 2755 2791 UINT min_rel_offset, max_rel_offset; 2756 2792 UINT rel_offset; 2757 2758 UINT recompile_count;2759 2793 } IWineD3DVertexShaderImpl; 2760 extern const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl; 2761 2762 void find_vs_compile_args(IWineD3DVertexShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, struct vs_compile_args *args); 2794 2795 void find_vs_compile_args(IWineD3DVertexShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, 2796 struct vs_compile_args *args) DECLSPEC_HIDDEN; 2797 HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *device, 2798 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, 2799 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2763 2800 2764 2801 /***************************************************************************** … … 2790 2827 IWineD3DBaseShaderClass baseShader; 2791 2828 2792 /* IWineD3DPixelShaderImpl */2793 IUnknown *parent;2794 2795 2829 /* Pixel shader input semantics */ 2796 2830 struct wined3d_shader_signature_element input_signature[MAX_REG_INPUT]; … … 2799 2833 unsigned int declared_in_count; 2800 2834 2801 /* The GL shader */2802 void *backend_priv;2803 2804 2835 /* Some information about the shader behavior */ 2805 2836 char vpos_uniform; … … 2810 2841 } IWineD3DPixelShaderImpl; 2811 2842 2812 extern const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl; 2813 void pixelshader_update_samplers(struct shader_reg_maps *reg_maps, IWineD3DBaseTexture * const *textures); 2814 void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, struct ps_compile_args *args); 2843 HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device, 2844 const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, 2845 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2846 void pixelshader_update_samplers(struct shader_reg_maps *reg_maps, 2847 IWineD3DBaseTexture * const *textures) DECLSPEC_HIDDEN; 2848 void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, 2849 struct ps_compile_args *args) DECLSPEC_HIDDEN; 2815 2850 2816 2851 /* sRGB correction constants */ … … 2842 2877 }; 2843 2878 2844 extern const IWineD3DPaletteVtbl IWineD3DPalette_Vtbl ;2845 DWORD IWineD3DPaletteImpl_Size(DWORD dwFlags) ;2879 extern const IWineD3DPaletteVtbl IWineD3DPalette_Vtbl DECLSPEC_HIDDEN; 2880 DWORD IWineD3DPaletteImpl_Size(DWORD dwFlags) DECLSPEC_HIDDEN; 2846 2881 2847 2882 /* DirectDraw utility functions */ 2848 extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) ;2883 extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN; 2849 2884 2850 2885 /***************************************************************************** … … 2861 2896 #define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x40 2862 2897 #define WINED3DFMT_FLAG_COMPRESSED 0x80 2898 #define WINED3DFMT_FLAG_GETDC 0x100 2863 2899 2864 2900 struct GlPixelFormatDesc … … 2894 2930 }; 2895 2931 2896 const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const struct wined3d_gl_info *gl_info); 2932 const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, 2933 const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 2897 2934 2898 2935 static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock) 2899 2936 { 2937 /* Check stateblock->vertexDecl to allow this to be used from 2938 * IWineD3DDeviceImpl_FindTexUnitMap(). This is safe because 2939 * stateblock->vertexShader implies a vertex declaration instead of ddraw 2940 * style strided data. */ 2900 2941 return (stateblock->vertexShader 2901 && ! stateblock->wineD3DDevice->strided_streams.position_transformed2942 && !((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->position_transformed 2902 2943 && stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE); 2903 2944 } … … 2909 2950 } 2910 2951 2911 void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect, 2912 IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip); 2952 void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, 2953 WINED3DRECT *src_rect, IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, 2954 const WINED3DTEXTUREFILTERTYPE filter, BOOL flip) DECLSPEC_HIDDEN; 2913 2955 2914 2956 /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
Note:
See TracChangeset
for help on using the changeset viewer.