Changeset 82718 in vbox
- Timestamp:
- Jan 10, 2020 4:25:50 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r82609 r82718 6908 6908 { 6909 6909 case SVGA3D_SHADERTYPE_VS: 6910 rc = ShaderCreateVertexShader(pContext->pShaderContext, (const uint32_t *)pShaderData, &pShader->u.pVertexShader);6910 rc = ShaderCreateVertexShader(pContext->pShaderContext, (const uint32_t *)pShaderData, cbData, &pShader->u.pVertexShader); 6911 6911 AssertRC(rc); 6912 6912 break; 6913 6913 6914 6914 case SVGA3D_SHADERTYPE_PS: 6915 rc = ShaderCreatePixelShader(pContext->pShaderContext, (const uint32_t *)pShaderData, &pShader->u.pPixelShader);6915 rc = ShaderCreatePixelShader(pContext->pShaderContext, (const uint32_t *)pShaderData, cbData, &pShader->u.pPixelShader); 6916 6916 AssertRC(rc); 6917 6917 break; -
trunk/src/VBox/Devices/Graphics/shaderlib/shader.c
r82711 r82718 1568 1568 } 1569 1569 shader->baseShader.frontend = fe; 1570 shader->baseShader.frontend_data = fe->shader_init(byte_code, output_signature);1570 shader->baseShader.frontend_data = fe->shader_init(byte_code, shader->baseShader.functionLength / 4, output_signature); 1571 1571 if (!shader->baseShader.frontend_data) 1572 1572 { -
trunk/src/VBox/Devices/Graphics/shaderlib/shader_sm1.c
r62948 r82718 213 213 { 214 214 struct wined3d_shader_version shader_version; 215 const DWORD *end; 215 216 const struct wined3d_sm1_opcode_info *opcode_table; 216 217 }; … … 518 519 } 519 520 520 static void *shader_sm1_init(const DWORD *byte_code, const struct wined3d_shader_signature *output_signature)521 static void *shader_sm1_init(const DWORD *byte_code, DWORD tokens_num, const struct wined3d_shader_signature *output_signature) 521 522 { 522 523 struct wined3d_sm1_data *priv; … … 537 538 return NULL; 538 539 } 540 541 priv->end = byte_code + tokens_num; 539 542 540 543 if (output_signature) … … 674 677 static BOOL shader_sm1_is_end(void *data, const DWORD **ptr) 675 678 { 679 struct wined3d_sm1_data *priv = data; 680 681 if (*ptr >= priv->end) 682 { 683 return TRUE; 684 } 685 676 686 if (**ptr == WINED3DSP_END) 677 687 { -
trunk/src/VBox/Devices/Graphics/shaderlib/shader_sm4.c
r53201 r82718 229 229 } 230 230 231 static void *shader_sm4_init(const DWORD *byte_code, const struct wined3d_shader_signature *output_signature)231 static void *shader_sm4_init(const DWORD *byte_code, DWORD tokens_num, const struct wined3d_shader_signature *output_signature) 232 232 { 233 233 struct wined3d_sm4_data *priv = HeapAlloc(GetProcessHeap(), 0, sizeof(*priv)); … … 238 238 } 239 239 240 priv->end = byte_code + tokens_num; 240 241 priv->output_signature = output_signature; 241 242 … … 425 426 { 426 427 struct wined3d_sm4_data *priv = data; 427 return *ptr == priv->end;428 return *ptr >= priv->end; 428 429 } 429 430 -
trunk/src/VBox/Devices/Graphics/shaderlib/shaderapi.c
r81981 r82718 314 314 } 315 315 316 SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj)316 SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj) 317 317 { 318 318 IWineD3DDeviceImpl *This; … … 329 329 return VERR_NO_MEMORY; 330 330 } 331 332 object->baseShader.functionLength = cbShaderData; 331 333 332 334 hr = vertexshader_init(object, This, (DWORD const *)pShaderData, NULL, NULL, NULL); … … 356 358 } 357 359 358 SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj)360 SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj) 359 361 { 360 362 IWineD3DDeviceImpl *This; … … 371 373 return VERR_NO_MEMORY; 372 374 } 375 376 object->baseShader.functionLength = cbShaderData; 373 377 374 378 hr = pixelshader_init(object, This, (DWORD const *)pShaderData, NULL, NULL, NULL); -
trunk/src/VBox/Devices/Graphics/shaderlib/shaderlib.h
r76565 r82718 72 72 SHADERDECL(int) ShaderContextDestroy(void *pShaderContext); 73 73 74 SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj);75 SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj);74 SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj); 75 SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj); 76 76 77 77 SHADERDECL(int) ShaderDestroyVertexShader(void *pShaderContext, void *pShaderObj); -
trunk/src/VBox/Devices/Graphics/shaderlib/wined3d_private.h
r82704 r82718 676 676 struct wined3d_shader_frontend 677 677 { 678 void *(*shader_init)(const DWORD *ptr, const struct wined3d_shader_signature *output_signature);678 void *(*shader_init)(const DWORD *ptr, DWORD tokens_num, const struct wined3d_shader_signature *output_signature); 679 679 void (*shader_free)(void *data); 680 680 void (*shader_read_header)(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version);
Note:
See TracChangeset
for help on using the changeset viewer.