- Timestamp:
- Nov 9, 2014 8:53:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/shaderlib/glsl_shader.c
r53222 r53277 139 139 }; 140 140 141 #ifdef VBOX_WITH_VMSVGA 142 # define WINEFIXUPINFO_NOINDEX (~0U) 143 #else 141 144 #define WINEFIXUPINFO_NOINDEX (~0UL) 145 #endif 142 146 #define WINEFIXUPINFO_GET(_p) get_fixup_info((const IWineD3DPixelShaderImpl*)(_p)->pshader, (_p)->inp2Fixup_info) 143 147 #define WINEFIXUPINFO_ISVALID(_p) ((_p)->inp2Fixup_info != WINEFIXUPINFO_NOINDEX) 148 #ifdef VBOX_WITH_VMSVGA 149 # define WINEFIXUPINFO_INIT(_p) do { (_p)->inp2Fixup_info = WINEFIXUPINFO_NOINDEX; } while (0) 150 #else 144 151 #define WINEFIXUPINFO_INIT(_p) ((_p)->inp2Fixup_info == WINEFIXUPINFO_NOINDEX) 152 #endif 145 153 146 154 typedef struct { … … 394 402 if (!tmp) 395 403 { 396 ERR("Program % u link status invalid.\n",program);404 ERR("Program %p link status invalid.\n", (void *)(uintptr_t)program); 397 405 #ifndef VBOXWINEDBG_SHADERS 398 406 shader_glsl_dump_program_source(gl_info, program); … … 413 421 if (!tmp) 414 422 { 415 ERR("Shader % u compile status invalid.\n",program);423 ERR("Shader %p compile status invalid.\n", (void *)(uintptr_t)program); 416 424 shader_glsl_dump_shader_source(gl_info, program); 417 425 } … … 3803 3811 if (context_get_current() == entry->context) 3804 3812 { 3805 TRACE("deleting program % u\n",entry->programId);3813 TRACE("deleting program %p\n", (void *)(uintptr_t)entry->programId); 3806 3814 GL_EXTCALL(glDeleteObjectARB(entry->programId)); 3807 3815 checkGLcall("glDeleteObjectARB"); … … 3809 3817 else 3810 3818 { 3811 WARN("Attempting to delete program % u created in ctx %p from ctx %p\n",entry->programId, entry->context, context_get_current());3819 WARN("Attempting to delete program %p created in ctx %p from ctx %p\n", (void *)(uintptr_t)entry->programId, entry->context, context_get_current()); 3812 3820 } 3813 3821 … … 4005 4013 /* GL locking is done by the caller */ 4006 4014 static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer *buffer, 4007 IWineD3DVertexShader * vertexshader, IWineD3DPixelShader *pixelshader, const struct wined3d_gl_info *gl_info)4015 IWineD3DVertexShader *a_vertexshader, IWineD3DPixelShader *pixelshader, const struct wined3d_gl_info *gl_info) 4008 4016 { 4009 4017 GLhandleARB ret = 0; 4010 IWineD3DVertexShaderImpl *vs = (IWineD3DVertexShaderImpl *) vertexshader;4018 IWineD3DVertexShaderImpl *vs = (IWineD3DVertexShaderImpl *) a_vertexshader; 4011 4019 IWineD3DPixelShaderImpl *ps = (IWineD3DPixelShaderImpl *) pixelshader; 4012 4020 IWineD3DDeviceImpl *device; … … 4172 4180 4173 4181 /* GL locking is done by the caller */ 4182 #ifdef VBOX_WITH_VMSVGA 4183 static GLhandleARB shader_glsl_generate_pshader(const struct wined3d_context *context, 4184 #else 4174 4185 static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context, 4186 #endif 4175 4187 struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *This, 4176 4188 const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info) … … 4268 4280 shader_addline(buffer, "}\n"); 4269 4281 4270 TRACE("Compiling shader object % u\n",shader_obj);4282 TRACE("Compiling shader object %p\n", (void *)(uintptr_t)shader_obj); 4271 4283 GL_EXTCALL(glShaderSourceARB(shader_obj, 1, (const char**)&buffer->buffer, NULL)); 4272 4284 GL_EXTCALL(glCompileShaderARB(shader_obj)); … … 4278 4290 4279 4291 /* GL locking is done by the caller */ 4292 #ifdef VBOX_WITH_VMSVGA 4293 static GLhandleARB shader_glsl_generate_vshader(const struct wined3d_context *context, 4294 #else 4280 4295 static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context, 4296 #endif 4281 4297 struct wined3d_shader_buffer *buffer, IWineD3DVertexShaderImpl *This, 4282 4298 const struct vs_compile_args *args) … … 4344 4360 shader_addline(buffer, "}\n"); 4345 4361 4346 TRACE("Compiling shader object % u\n",shader_obj);4362 TRACE("Compiling shader object %p\n", (void *)(uintptr_t)shader_obj); 4347 4363 GL_EXTCALL(glShaderSourceARB(shader_obj, 1, (const char**)&buffer->buffer, NULL)); 4348 4364 GL_EXTCALL(glCompileShaderARB(shader_obj)); … … 4509 4525 /* GL locking is done by the caller */ 4510 4526 static void set_glsl_shader_program(const struct wined3d_context *context, 4511 IWineD3DDeviceImpl *device, BOOL use_ps, BOOLuse_vs)4512 { 4513 IWineD3DVertexShader *vshader = use_vs ? device->stateBlock->vertexShader : NULL;4514 IWineD3DPixelShader *pshader = use_ps ? device->stateBlock->pixelShader : NULL;4527 IWineD3DDeviceImpl *device, BOOL a_use_ps, BOOL a_use_vs) 4528 { 4529 IWineD3DVertexShader *vshader = a_use_vs ? device->stateBlock->vertexShader : NULL; 4530 IWineD3DPixelShader *pshader = a_use_ps ? device->stateBlock->pixelShader : NULL; 4515 4531 const struct wined3d_gl_info *gl_info = context->gl_info; 4516 4532 struct shader_glsl_priv *priv = device->shader_priv; … … 4534 4550 /* If we get to this point, then no matching program exists, so we create one */ 4535 4551 programId = GL_EXTCALL(glCreateProgramObjectARB()); 4536 TRACE("Created new GLSL shader program % u\n",programId);4552 TRACE("Created new GLSL shader program %p\n", (void *)(uintptr_t)programId); 4537 4553 4538 4554 /* Create the entry */ … … 4561 4577 4562 4578 reorder_shader_id = generate_param_reorder_function(&priv->shader_buffer, vshader, pshader, gl_info); 4563 TRACE("Attaching GLSL shader object % u to program %u\n", reorder_shader_id,programId);4579 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)reorder_shader_id, (void *)(uintptr_t)programId); 4564 4580 GL_EXTCALL(glAttachObjectARB(programId, reorder_shader_id)); 4565 4581 checkGLcall("glAttachObjectARB"); … … 4569 4585 GL_EXTCALL(glDeleteObjectARB(reorder_shader_id)); 4570 4586 4571 TRACE("Attaching GLSL shader object % u to program %u\n", vshader_id,programId);4587 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)vshader_id, (void *)(uintptr_t)programId); 4572 4588 GL_EXTCALL(glAttachObjectARB(programId, vshader_id)); 4573 4589 checkGLcall("glAttachObjectARB"); … … 4601 4617 &entry->inp2Fixup_info 4602 4618 ); 4603 TRACE("Attaching GLSL shader object % u to program %u\n", pshader_id,programId);4619 TRACE("Attaching GLSL shader object %p to program %p\n", (void *)(uintptr_t)pshader_id, (void *)(uintptr_t)programId); 4604 4620 GL_EXTCALL(glAttachObjectARB(programId, pshader_id)); 4605 4621 checkGLcall("glAttachObjectARB"); … … 4609 4625 4610 4626 /* Link the program */ 4611 TRACE("Linking GLSL shader program % u\n",programId);4627 TRACE("Linking GLSL shader program %p\n", (void *)(uintptr_t)programId); 4612 4628 GL_EXTCALL(glLinkProgramARB(programId)); 4613 4629 shader_glsl_validate_compile_link(gl_info, programId, TRUE); … … 4667 4683 && ((IWineD3DPixelShaderImpl *)pshader)->declared_in_count > vec4_varyings(3, gl_info)) 4668 4684 { 4669 TRACE("Shader % d needs vertex color clamping disabled\n",programId);4685 TRACE("Shader %p needs vertex color clamping disabled\n", (void *)(uintptr_t)programId); 4670 4686 entry->vertex_color_clamp = GL_FALSE; 4671 4687 } else { … … 4817 4833 4818 4834 program_id = priv->glsl_program ? priv->glsl_program->programId : 0; 4819 if (program_id) TRACE("Using GLSL program % u\n",program_id);4835 if (program_id) TRACE("Using GLSL program %p\n", (void *)(uintptr_t)program_id); 4820 4836 GL_EXTCALL(glUseProgramObjectARB(program_id)); 4821 4837 checkGLcall("glUseProgramObjectARB"); … … 4877 4893 4878 4894 program_id = priv->glsl_program ? priv->glsl_program->programId : 0; 4879 if (program_id) TRACE("Using GLSL program % u\n",program_id);4895 if (program_id) TRACE("Using GLSL program %p\n", (void *)(uintptr_t)program_id); 4880 4896 4881 4897 GL_EXTCALL(glUseProgramObjectARB(program_id)); … … 4970 4986 if (shader_data->gl_shaders[i].context==context_get_current()) 4971 4987 { 4972 TRACE("deleting pshader % u\n",shader_data->gl_shaders[i].prgId);4988 TRACE("deleting pshader %p\n", (void *)(uintptr_t)shader_data->gl_shaders[i].prgId); 4973 4989 GL_EXTCALL(glDeleteObjectARB(shader_data->gl_shaders[i].prgId)); 4974 4990 checkGLcall("glDeleteObjectARB"); … … 4976 4992 else 4977 4993 { 4978 WARN("Attempting to delete pshader % u created in ctx %p from ctx %p\n",4979 shader_data->gl_shaders[i].prgId, shader_data->gl_shaders[i].context, context_get_current());4994 WARN("Attempting to delete pshader %p created in ctx %p from ctx %p\n", 4995 (void *)(uintptr_t)shader_data->gl_shaders[i].prgId, shader_data->gl_shaders[i].context, context_get_current()); 4980 4996 } 4981 4997 } … … 4992 5008 if (shader_data->gl_shaders[i].context==context_get_current()) 4993 5009 { 4994 TRACE("deleting vshader % u\n",shader_data->gl_shaders[i].prgId);5010 TRACE("deleting vshader %p\n", (void *)(uintptr_t)shader_data->gl_shaders[i].prgId); 4995 5011 GL_EXTCALL(glDeleteObjectARB(shader_data->gl_shaders[i].prgId)); 4996 5012 checkGLcall("glDeleteObjectARB"); … … 4998 5014 else 4999 5015 { 5000 WARN("Attempting to delete vshader % u created in ctx %p from ctx %p\n",5001 shader_data->gl_shaders[i].prgId, shader_data->gl_shaders[i].context, context_get_current());5016 WARN("Attempting to delete vshader %p created in ctx %p from ctx %p\n", 5017 (void *)(uintptr_t)shader_data->gl_shaders[i].prgId, shader_data->gl_shaders[i].context, context_get_current()); 5002 5018 } 5003 5019 }
Note:
See TracChangeset
for help on using the changeset viewer.