儲存庫 vbox 的更動 30885
- 時間撮記:
- 2010-7-16 下午05:11:31 (14 年 以前)
- 位置:
- trunk/src/VBox/Additions/WINNT/Graphics
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30865 r30885 1253 1253 {FALSE, D3DTSS_ALPHAARG0}, /* 27, D3DDDITSS_ALPHAARG0 */ 1254 1254 {FALSE, D3DTSS_RESULTARG}, /* 28, D3DDDITSS_RESULTARG */ 1255 { FALSE, D3DTSS_FORCE_DWORD}, /* 29, D3DDDITSS_SRGBTEXTURE */1256 { FALSE, D3DTSS_FORCE_DWORD},/* 30, D3DDDITSS_ELEMENTINDEX */1257 { FALSE, D3DTSS_FORCE_DWORD},/* 31, D3DDDITSS_DMAPOFFSET */1255 {TRUE, D3DSAMP_SRGBTEXTURE}, /* 29, D3DDDITSS_SRGBTEXTURE */ 1256 {TRUE, D3DSAMP_ELEMENTINDEX}, /* 30, D3DDDITSS_ELEMENTINDEX */ 1257 {TRUE, D3DSAMP_DMAPOFFSET}, /* 31, D3DDDITSS_DMAPOFFSET */ 1258 1258 {FALSE, D3DTSS_CONSTANT}, /* 32, D3DDDITSS_CONSTANT */ 1259 1259 {FALSE, D3DTSS_FORCE_DWORD}, /* 33, D3DDDITSS_DISABLETEXTURECOLORKEY */ 1260 1260 {FALSE, D3DTSS_FORCE_DWORD}, /* 34, D3DDDITSS_TEXTURECOLORKEYVAL */ 1261 1261 }; 1262 1263 Assert(enmType > 0); 1264 Assert(enmType < RT_ELEMENTS(lookup)); 1265 Assert(lookup[enmType].dType != D3DTSS_FORCE_DWORD); 1262 1266 1263 1267 return lookup[enmType]; … … 4470 4474 Assert(pRc); 4471 4475 Assert(pData->SubResourceIndex < pRc->cAllocations); 4472 Assert(pRc == pDevice->pRenderTargetRc);4473 4476 if (pRc == pDevice->pRenderTargetRc) 4474 4477 { -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h
r30865 r30885 38 38 # define VBOXWDDMDISP_DEBUG 39 39 # define VBOXWDDMDISP_DEBUG_FLOW 40 //# define VBOXWDDMDISP_DEBUG_DUMPSURFDATA 40 41 #endif 41 42 … … 82 83 vboxVDbgDoMpPrintAlloc _m ; \ 83 84 } while (0) 85 #ifdef VBOXWDDMDISP_DEBUG_DUMPSURFDATA 84 86 #define vboxVDbgDumpSurfData(_m) \ 85 87 do { \ 86 88 vboxVDbgDoDumpSurfData _m ; \ 87 89 } while (0) 90 #else 91 #define vboxVDbgDumpSurfData(_m) do {} while (0) 92 #endif 88 93 #ifdef VBOXWDDMDISP_DEBUG_FLOW 89 94 # define vboxVDbgPrintF vboxVDbgPrint -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c
r28475 r30885 126 126 struct ps_compile_args ps_args; 127 127 UINT constant_version; 128 #ifdef VBOXWDDM 129 UINT inp2Fixup_info; 130 #else 128 131 const struct ps_np2fixup_info *np2Fixup_info; 132 #endif 129 133 }; 134 135 #ifdef VBOXWDDM 136 #define WINEFIXUPINFO_NOINDEX (~0UL) 137 #define WINEFIXUPINFO_GET(_p) get_fixup_info((const IWineD3DPixelShaderImpl*)(_p)->pshader, (_p)->inp2Fixup_info) 138 #define WINEFIXUPINFO_ISVALID(_p) ((_p)->inp2Fixup_info != WINEFIXUPINFO_NOINDEX) 139 #define WINEFIXUPINFO_INIT(_p) ((_p)->inp2Fixup_info == WINEFIXUPINFO_NOINDEX) 140 #else 141 #define WINEFIXUPINFO_GET(_p) ((_p)->np2Fixup_info) 142 #define WINEFIXUPINFO_ISVALID(_p) (!!(_p)->np2Fixup_info) 143 #define WINEFIXUPINFO_INIT(_p) ((_p)->np2Fixup_info == NULL) 144 #endif 130 145 131 146 typedef struct { … … 673 688 } 674 689 690 #ifdef VBOXWDDM 691 static const struct ps_np2fixup_info * get_fixup_info(const IWineD3DPixelShaderImpl *shader, UINT inp2fixup_info) 692 { 693 struct glsl_pshader_private *shader_data = shader->baseShader.backend_data; 694 695 if (inp2fixup_info == WINEFIXUPINFO_NOINDEX) 696 return NULL; 697 698 if (!shader->baseShader.backend_data) 699 { 700 ERR("no backend data\n"); 701 return NULL; 702 } 703 shader_data = shader->baseShader.backend_data; 704 705 if (inp2fixup_info >= shader_data->num_gl_shaders) 706 { 707 ERR("invalid index\n"); 708 return NULL; 709 } 710 711 return &shader_data->gl_shaders[inp2fixup_info].np2fixup; 712 } 713 #endif 714 675 715 /** 676 716 * Loads the texture dimensions for NP2 fixup into the currently set GLSL program. … … 702 742 GLfloat np2fixup_constants[4 * MAX_FRAGMENT_SAMPLERS]; 703 743 744 const struct ps_np2fixup_info *np2Fixup_info = WINEFIXUPINFO_GET(prog); 745 704 746 for (i = 0; fixup; fixup >>= 1, ++i) { 705 const unsigned char idx = prog->np2Fixup_info->idx[i];747 const unsigned char idx = np2Fixup_info->idx[i]; 706 748 const IWineD3DBaseTextureImpl* const tex = (const IWineD3DBaseTextureImpl*) stateBlock->textures[i]; 707 749 GLfloat* tex_dim = &np2fixup_constants[(idx >> 1) * 4]; … … 719 761 } 720 762 721 GL_EXTCALL(glUniform4fvARB(prog->np2Fixup_location, prog->np2Fixup_info->num_consts, np2fixup_constants));763 GL_EXTCALL(glUniform4fvARB(prog->np2Fixup_location, np2Fixup_info->num_consts, np2fixup_constants)); 722 764 } 723 765 } … … 4136 4178 static GLhandleARB find_glsl_pshader(const struct wined3d_context *context, 4137 4179 struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *shader, 4138 const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info) 4180 const struct ps_compile_args *args, 4181 #ifdef VBOXWDDM 4182 UINT *inp2fixup_info 4183 #else 4184 const struct ps_np2fixup_info **np2fixup_info 4185 #endif 4186 ) 4139 4187 { 4140 4188 UINT i; … … 4162 4210 for(i = 0; i < shader_data->num_gl_shaders; i++) { 4163 4211 if(memcmp(&shader_data->gl_shaders[i].args, args, sizeof(*args)) == 0) { 4164 if(args->np2_fixup) *np2fixup_info = &shader_data->gl_shaders[i].np2fixup; 4212 if(args->np2_fixup) { 4213 #ifdef VBOXWDDM 4214 *inp2fixup_info = i; 4215 #else 4216 *np2fixup_info = &shader_data->gl_shaders[i].np2fixup; 4217 #endif 4218 } 4165 4219 return shader_data->gl_shaders[i].prgId; 4166 4220 } … … 4197 4251 shader_buffer_clear(buffer); 4198 4252 ret = shader_glsl_generate_pshader(context, buffer, shader, args, np2fixup); 4253 #ifdef VBOXWDDM 4254 *inp2fixup_info = shader_data->num_gl_shaders; 4255 #else 4256 *np2fixup_info = np2fixup; 4257 #endif 4199 4258 shader_data->gl_shaders[shader_data->num_gl_shaders++].prgId = ret; 4200 *np2fixup_info = np2fixup;4201 4259 4202 4260 return ret; … … 4318 4376 entry->ps_args = ps_compile_args; 4319 4377 entry->constant_version = 0; 4320 entry->np2Fixup_info = NULL;4378 WINEFIXUPINFO_INIT(entry); 4321 4379 /* Add the hash table entry */ 4322 4380 add_glsl_program_entry(priv, entry); … … 4371 4429 { 4372 4430 GLhandleARB pshader_id = find_glsl_pshader(context, &priv->shader_buffer, 4373 (IWineD3DPixelShaderImpl *)pshader, &ps_compile_args, &entry->np2Fixup_info); 4431 (IWineD3DPixelShaderImpl *)pshader, &ps_compile_args, 4432 #ifdef VBOXWDDM 4433 &entry->inp2Fixup_info 4434 #else 4435 &entry->np2Fixup_info 4436 #endif 4437 ); 4374 4438 TRACE("Attaching GLSL shader object %u to program %u\n", pshader_id, programId); 4375 4439 GL_EXTCALL(glAttachObjectARB(programId, pshader_id)); … … 4422 4486 4423 4487 if (ps_compile_args.np2_fixup) { 4424 if ( entry->np2Fixup_info) {4488 if (WINEFIXUPINFO_ISVALID(entry)) { 4425 4489 entry->np2Fixup_location = GL_EXTCALL(glGetUniformLocationARB(programId, "PsamplerNP2Fixup")); 4426 4490 } else { … … 4585 4649 * constants. This has to be done because it can't be guaranteed that sampler() (from state.c) is 4586 4650 * called between selecting the shader and using it, which results in wrong fixup for some frames. */ 4587 if (priv->glsl_program && priv->glsl_program->np2Fixup_info)4651 if (priv->glsl_program && WINEFIXUPINFO_ISVALID(priv->glsl_program)) 4588 4652 { 4589 4653 shader_glsl_load_np2fixup_constants((IWineD3DDevice *)device, usePS, useVS);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器