Changeset 25949 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/baseshader.c
- Timestamp:
- Jan 21, 2010 9:26:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/baseshader.c
r23571 r25949 56 56 /* WINED3DSIH_CND */ "cnd", 57 57 /* WINED3DSIH_CRS */ "crs", 58 /* WINED3DSIH_CUT */ "cut", 58 59 /* WINED3DSIH_DCL */ "dcl", 59 60 /* WINED3DSIH_DEF */ "def", … … 67 68 /* WINED3DSIH_DSY */ "dsy", 68 69 /* WINED3DSIH_ELSE */ "else", 70 /* WINED3DSIH_EMIT */ "emit", 69 71 /* WINED3DSIH_ENDIF */ "endif", 70 72 /* WINED3DSIH_ENDLOOP */ "endloop", … … 73 75 /* WINED3DSIH_EXPP */ "expp", 74 76 /* WINED3DSIH_FRC */ "frc", 77 /* WINED3DSIH_IADD */ "iadd", 75 78 /* WINED3DSIH_IF */ "if", 76 79 /* WINED3DSIH_IFC */ "ifc", 80 /* WINED3DSIH_IGE */ "ige", 77 81 /* WINED3DSIH_LABEL */ "label", 78 82 /* WINED3DSIH_LIT */ "lit", … … 81 85 /* WINED3DSIH_LOOP */ "loop", 82 86 /* WINED3DSIH_LRP */ "lrp", 87 /* WINED3DSIH_LT */ "lt", 83 88 /* WINED3DSIH_M3x2 */ "m3x2", 84 89 /* WINED3DSIH_M3x3 */ "m3x3", … … 374 379 } 375 380 381 static const char *semantic_names[] = 382 { 383 /* WINED3DDECLUSAGE_POSITION */ "SV_POSITION", 384 /* WINED3DDECLUSAGE_BLENDWEIGHT */ "BLENDWEIGHT", 385 /* WINED3DDECLUSAGE_BLENDINDICES */ "BLENDINDICES", 386 /* WINED3DDECLUSAGE_NORMAL */ "NORMAL", 387 /* WINED3DDECLUSAGE_PSIZE */ "PSIZE", 388 /* WINED3DDECLUSAGE_TEXCOORD */ "TEXCOORD", 389 /* WINED3DDECLUSAGE_TANGENT */ "TANGENT", 390 /* WINED3DDECLUSAGE_BINORMAL */ "BINORMAL", 391 /* WINED3DDECLUSAGE_TESSFACTOR */ "TESSFACTOR", 392 /* WINED3DDECLUSAGE_POSITIONT */ "POSITIONT", 393 /* WINED3DDECLUSAGE_COLOR */ "COLOR", 394 /* WINED3DDECLUSAGE_FOG */ "FOG", 395 /* WINED3DDECLUSAGE_DEPTH */ "DEPTH", 396 /* WINED3DDECLUSAGE_SAMPLE */ "SAMPLE", 397 }; 398 376 399 static const char *shader_semantic_name_from_usage(WINED3DDECLUSAGE usage) 377 400 { 378 static const char *semantic_names[] =379 {380 /* WINED3DDECLUSAGE_POSITION */ "SV_POSITION",381 /* WINED3DDECLUSAGE_BLENDWEIGHT */ "BLENDWEIGHT",382 /* WINED3DDECLUSAGE_BLENDINDICES */ "BLENDINDICES",383 /* WINED3DDECLUSAGE_NORMAL */ "NORMAL",384 /* WINED3DDECLUSAGE_PSIZE */ "PSIZE",385 /* WINED3DDECLUSAGE_TEXCOORD */ "TEXCOORD",386 /* WINED3DDECLUSAGE_TANGENT */ "TANGENT",387 /* WINED3DDECLUSAGE_BINORMAL */ "BINORMAL",388 /* WINED3DDECLUSAGE_TESSFACTOR */ "TESSFACTOR",389 /* WINED3DDECLUSAGE_POSITIONT */ "POSITIONT",390 /* WINED3DDECLUSAGE_COLOR */ "COLOR",391 /* WINED3DDECLUSAGE_FOG */ "FOG",392 /* WINED3DDECLUSAGE_DEPTH */ "DEPTH",393 /* WINED3DDECLUSAGE_SAMPLE */ "SAMPLE",394 };395 396 401 if (usage >= sizeof(semantic_names) / sizeof(*semantic_names)) 397 402 { … … 401 406 402 407 return semantic_names[usage]; 408 } 409 410 WINED3DDECLUSAGE shader_usage_from_semantic_name(const char *name) 411 { 412 unsigned int i; 413 414 for (i = 0; i < sizeof(semantic_names) / sizeof(*semantic_names); ++i) 415 { 416 if (!strcmp(name, semantic_names[i])) return i; 417 } 418 419 return ~0U; 403 420 } 404 421 … … 423 440 424 441 HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3d_shader_frontend *fe, 425 struct shader_reg_maps *reg_maps, struct wined3d_shader_attribute *attributes, 426 struct wined3d_shader_signature_element *input_signature, 442 struct shader_reg_maps *reg_maps, struct wined3d_shader_signature_element *input_signature, 427 443 struct wined3d_shader_signature_element *output_signature, const DWORD *byte_code, DWORD constf_size) 428 444 { … … 484 500 switch (semantic.reg.reg.type) 485 501 { 486 /* Vshader: mark attributes used 487 * Pshader: mark 3.0 input registers used, save token */ 502 /* Mark input registers used. */ 488 503 case WINED3DSPR_INPUT: 489 504 reg_maps->input_registers |= 1 << semantic.reg.reg.idx; 490 if (shader_version.type == WINED3D_SHADER_TYPE_VERTEX) 491 { 492 attributes[semantic.reg.reg.idx].usage = semantic.usage; 493 attributes[semantic.reg.reg.idx].usage_idx = semantic.usage_idx; 494 } 495 else 496 { 497 shader_signature_from_semantic(&input_signature[semantic.reg.reg.idx], &semantic); 498 } 505 shader_signature_from_semantic(&input_signature[semantic.reg.reg.idx], &semantic); 499 506 break; 500 507 … … 1402 1409 static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;} 1403 1410 1404 #define GLINFO_LOCATION (*gl_info)1405 1411 static void shader_none_get_caps(WINED3DDEVTYPE devtype, 1406 1412 const struct wined3d_gl_info *gl_info, struct shader_caps *pCaps) … … 1411 1417 pCaps->PixelShader1xMaxValue = 0.0f; 1412 1418 } 1413 #undef GLINFO_LOCATION 1419 1414 1420 static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup) 1415 1421 {
Note:
See TracChangeset
for help on using the changeset viewer.