Sign in to follow this  

Is calling SetStreamSourceFreq after SetStreamSource necessary?

This topic is 1456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have capture a frame by nsight and find there are a lot of SetStreamSourceFreq. but their parameters are always 1.

 

a part of all codes.

E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(147):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(385):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(391):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(397):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(455):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(461):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(467):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(522):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(528):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(534):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(589):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(595):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(601):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(644):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(650):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(656):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(708):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(714):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(720):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(772):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(778):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(784):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(836):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(842):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(848):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(916):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(987):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(993):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1153):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1159):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1322):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1328):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1518):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1524):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1680):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1686):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1842):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(1848):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2029):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2035):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2041):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2103):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2109):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2115):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2237):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2243):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2249):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2368):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2374):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2380):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2442):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2448):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2454):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2504):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2510):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2516):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
  E:\Documents\NVIDIA Nsight\Captures\Test__2013_12_17__14_46_55\Frame0Part00.cpp(2566):    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);

     if in the game, the instance rendering is not used, should i delete all of the SetStreamSourceFreq to optimize the game?

     or i cache the last state of SetStreamSourceFreq, and call it when the parameter is changed?

 

 

 this is a full draw call:\

result = pIDirect3DDevice9_uidof_6->SetTexture(0, ((IDirect3DBaseTexture9*)pIDirect3DTexture9_uidof_37417));
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(0, D3DSAMP_MINFILTER, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(0, D3DSAMP_MAGFILTER, 2);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetTexture(1, ((IDirect3DBaseTexture9*)pIDirect3DTexture9_uidof_2835));
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_SRGBTEXTURE, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_MINFILTER, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_MAGFILTER, 2);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_ADDRESSU, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_ADDRESSV, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(1, D3DSAMP_ADDRESSW, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetTexture(2, ((IDirect3DBaseTexture9*)pIDirect3DTexture9_uidof_37395));
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(2, D3DSAMP_SRGBTEXTURE, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(2, D3DSAMP_MINFILTER, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(2, D3DSAMP_ADDRESSU, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(2, D3DSAMP_ADDRESSV, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(2, D3DSAMP_ADDRESSW, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetTexture(3, ((IDirect3DBaseTexture9*)pIDirect3DTexture9_uidof_2523));
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetTexture(4, ((IDirect3DBaseTexture9*)pIDirect3DCubeTexture9_uidof_8267));
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(4, D3DSAMP_ADDRESSU, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(4, D3DSAMP_ADDRESSV, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetSamplerState(4, D3DSAMP_ADDRESSW, 3);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSource(0, pIDirect3DVertexBuffer9_uidof_38626, 0, 12);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(0, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSource(1, pIDirect3DVertexBuffer9_uidof_38625, 0, 12);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(1, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSource(2, pIDirect3DVertexBuffer9_uidof_10692, 0, 0);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetStreamSourceFreq(2, 1);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetVertexDeclaration(pIDirect3DVertexDeclaration9_uidof_7847);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetVertexShader(pIDirect3DVertexShader9_uidof_9686);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetPixelShader(pIDirect3DPixelShader9_uidof_37337);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetRenderState(D3DRS_CULLMODE, 2);
    CHECK_RESULT(result);

    result = pIDirect3DDevice9_uidof_6->SetIndices(pIDirect3DIndexBuffer9_uidof_38623);
    CHECK_RESULT(result);

    static float float_temp_3[60] = { 
        HexToFloat(0xBFDDB3D7/*-1.73205f*/), HexToFloat(0x25A2EA12/*2.82611e-016f*/), HexToFloat(0x249C2EA1/*6.77332e-017f*/), HexToFloat(0x249C56A7/*6.7801e-017f*/), HexToFloat(0x25748B3E/*2.12108e-016f*/), HexToFloat(0x4013B28D/*2.30777f*/), HexToFloat(0x3F0D9816/*0.553102f*/), HexToFloat(0x3F0DBC5F/*0.553656f*/), 
        0.0f, HexToFloat(0x3FC46519/*1.53434f*/), HexToFloat(0xBF54F841/*-0.831913f*/), HexToFloat(0xBF552ED4/*-0.832746f*/), HexToFloat(0x3B5DB3D7/*0.00338291f*/), HexToFloat(0x3AB15CAC/*0.00135316f*/), HexToFloat(0xC11FD30B/*-9.98902f*/), HexToFloat(0x3A800000/*0.000976563f*/), 
        0.0f, 0.0f, 0.0f, HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0xC69E567A/*-20267.2f*/), HexToFloat(0x4651F667/*13437.6f*/), HexToFloat(0xC5F26CD5/*-7757.6f*/), HexToFloat(0x3F800000/*1.0f*/), 
        HexToFloat(0x3FAB6081/*1.33888f*/), HexToFloat(0x3E4B5EF8/*0.198604f*/), 0.0f, 0.0f, HexToFloat(0xBE4B5EF8/*-0.198604f*/), HexToFloat(0x3FAB6081/*1.33888f*/), 0.0f, 0.0f, 
        0.0f, 0.0f, HexToFloat(0x3FAD408E/*1.35353f*/), 0.0f, HexToFloat(0x45847494/*4238.57f*/), HexToFloat(0x45909500/*4626.63f*/), HexToFloat(0xC5FC0921/*-8065.14f*/), HexToFloat(0x3F800000/*1.0f*/), 
        HexToFloat(0x3F3B1670/*0.730811f*/), HexToFloat(0xBDDE03BF/*-0.108406f*/), 0.0f, 0.0f, HexToFloat(0x3DDE03BF/*0.108406f*/), HexToFloat(0x3F3B1670/*0.730811f*/), 0.0f, 0.0f, 
        0.0f, 0.0f, HexToFloat(0x3F3D227D/*0.738807f*/), 0.0f, HexToFloat(0xB9B60B61/*-0.000347222f*/), HexToFloat(0xBA11A2B4/*-0.000555556f*/), 0.0f, HexToFloat(0x3F80091A/*1.00028f*/), 
        HexToFloat(0x3F800000/*1.0f*/), 0.0f, 0.0f, HexToFloat(0xBF5560B5/*-0.833507f*/) };
    result = pIDirect3DDevice9_uidof_6->SetVertexShaderConstantF(0, float_temp_3, 15);
    CHECK_RESULT(result);

    static float float_temp_4[60] = { 
        0.0f, 0.0f, 0.0f, HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x3F000000/*0.5f*/), HexToFloat(0xBEFEDE05/*-0.497788f*/), HexToFloat(0x3EFF2683/*0.498341f*/), HexToFloat(0x3F0016C1/*0.500347f*/), 
        HexToFloat(0xC11FD70A/*-9.99f*/), HexToFloat(0x3F7FBE77/*0.999f*/), HexToFloat(0xBDCD0148/*-0.1001f*/), HexToFloat(0xBDCCCCCE/*-0.1f*/), 0.0f, 0.0f, 0.0f, 0.0f, 
        0.0f, 0.0f, 0.0f, HexToFloat(0x3F800000/*1.0f*/), 0.0f, 0.0f, 0.0f, HexToFloat(0x3F800000/*1.0f*/), 
        HexToFloat(0x469E567A/*20267.2f*/), HexToFloat(0xC651F667/*-13437.6f*/), HexToFloat(0x45F26CD5/*7757.6f*/), HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x44B40000/*1440.0f*/), HexToFloat(0x44610000/*900.0f*/), HexToFloat(0x3A360B61/*0.000694444f*/), HexToFloat(0x3A91A2B4/*0.00111111f*/), 
        HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x3F6429C0/*0.891262f*/), HexToFloat(0x3F4C02B9/*0.796917f*/), HexToFloat(0x40000000/*2.0f*/), HexToFloat(0x3F410598/*0.753992f*/), HexToFloat(0x3D832FD5/*0.0640561f*/), HexToFloat(0x3F275C62/*0.653753f*/), HexToFloat(0x3F800000/*1.0f*/), 
        HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x3F800000/*1.0f*/), HexToFloat(0x3F800000/*1.0f*/), 0.0f, HexToFloat(0x3E99999A/*0.3f*/), HexToFloat(0x3F99999A/*1.2f*/), HexToFloat(0x3F800000/*1.0f*/), 
        HexToFloat(0x40000000/*2.0f*/), HexToFloat(0x3EE66666/*0.45f*/), HexToFloat(0x3FC00000/*1.5f*/), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 
        0.0f, 0.0f, 0.0f, HexToFloat(0x3F800000/*1.0f*/) };
    result = pIDirect3DDevice9_uidof_6->SetPixelShaderConstantF(0, float_temp_4, 15);
    CHECK_RESULT(result);

    // Draw 1 of 423
    result = pIDirect3DDevice9_uidof_6->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 2563, 0, 238);
    CHECK_RESULT(result);

Share this post


Link to post
Share on other sites

You indeed don't need SetStreamSourceFreq at all if not using instancing, so you can delete it everywhere.

But you should think about implementing some state manager, because you are doing a lot of SetRenderState and SetSamplerState at each draw call and most probably a lot of them will be superfluous (setting the particular state to the same value as it already was). The state manager is quite simple, you need to remember the value for every render state and sampler state and then in your code you don't call directly SetRenderState and SetSamplerState of the device, but of your state manager - and the manager compares the value and decides whether to set it or not.

Don't forget that the fastest Direct3D API call is the one that never gets executed ;)

Share this post


Link to post
Share on other sites

This topic is 1456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this