Changeset 1389


Ignore:
Timestamp:
May 14, 2012, 2:14:37 PM (9 years ago)
Author:
sam
Message:

gpu: define the _XBOX macro in our HLSL compilation.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/shiny.lolfx

    r1387 r1389  
    9090                 * pow(max(dot(r, v), 0.0), specular_power);
    9191    float3 light = ambient + diffuse + specular;
    92     float4 real_color = in_Damage * float4(1.2, 0.2, 0.2, 1.0)
    93                       + (1.0 - in_Damage) * in_Color;
     92#ifdef _XBOX
     93    float4 real_color = in_Color.abgr;
     94#else
     95    float4 real_color = in_Color;
     96#endif
     97    real_color = in_Damage * float4(1.2, 0.2, 0.2, 1.0)
     98               + (1.0 - in_Damage) * real_color;
    9499    pass_Color = real_color * float4(light, 1.0);
    95100    out_Position = mul(in_Proj, eye);
  • trunk/src/gpu/shader.cpp

    r1385 r1389  
    172172    ID3DXBuffer *shader_code, *error_msg;
    173173    HRESULT hr;
     174    D3DXMACRO macros[] =
     175    {
     176#if defined _XBOX
     177        { "_XBOX", "1" },
     178#endif
     179        { NULL, NULL }
     180    };
    174181#elif !defined __CELLOS_LV2__
    175182    char buf[4096], errbuf[4096];
     
    186193    data->vert_crc = Hash::Crc32(vert);
    187194#if defined USE_D3D9 || defined _XBOX
    188     hr = D3DXCompileShader(vert, (UINT)strlen(vert), NULL, NULL, "main",
     195    hr = D3DXCompileShader(vert, (UINT)strlen(vert), macros, NULL, "main",
    189196                           "vs_2_0", 0, &shader_code, &error_msg,
    190197                           &data->vert_table);
     
    225232    data->frag_crc = Hash::Crc32(frag);
    226233#if defined USE_D3D9 || defined _XBOX
    227     hr = D3DXCompileShader(frag, (UINT)strlen(frag), NULL, NULL, "main",
     234    hr = D3DXCompileShader(frag, (UINT)strlen(frag), macros, NULL, "main",
    228235                           "ps_2_0", 0, &shader_code, &error_msg,
    229236                           &data->frag_table);
Note: See TracChangeset for help on using the changeset viewer.