XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Dimension Error

Last post 6/12/2009 5:50 PM by PhilTaylor. 1 replies.
  • 6/12/2009 3:12 AM

    Dimension Error



     D3D10_TEXTURE2D_DESC depthStencilDesc;
     depthStencilDesc.Width     = mClientWidth;
     depthStencilDesc.Height    = mClientHeight;
     depthStencilDesc.MipLevels = 1;
     depthStencilDesc.ArraySize = 1;
     depthStencilDesc.Format    = DXGI_FORMAT_R32_TYPELESS;
     depthStencilDesc.SampleDesc.Count   = 1; // multisampling must match
     depthStencilDesc.SampleDesc.Quality = 0; // swap chain values.
     depthStencilDesc.Usage          = D3D10_USAGE_DEFAULT;
     depthStencilDesc.BindFlags      =  D3D10_BIND_DEPTH_STENCIL | D3D10_BIND_SHADER_RESOURCE;
     depthStencilDesc.CPUAccessFlags = 0;
     depthStencilDesc.MiscFlags      = 0;
     HR(md3dDevice->CreateTexture2D(&depthStencilDesc, NULL, &mDepthStencilBuffer));

     // Create the depth stencil view
     D3D10_DEPTH_STENCIL_VIEW_DESC descDSV;
     //if( 1 == descDepth.SampleDesc.Count ) {
     descDSV.ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2D;
     descDSV.Format = DXGI_FORMAT_D32_FLOAT; // Make the view see this as D32_FLOAT instead of typeless
     descDSV.Texture2D.MipSlice = 0;
     HR(md3dDevice->CreateDepthStencilView(mDepthStencilBuffer, &descDSV, &mDepthStencilView));

    D3D10: ERROR: ID3D10Device::Draw: The view dimension declared in the shader code does not match the view type bound to slot 0 of the Pixel Shader unit. This is invalid if the shader actually uses the view (e.g. it is not skipped due to shader code branching). [ EXECUTION ERROR #354: DEVICE_DRAW_VIEW_DIMENSION_MISMATCH ]

    Actually I create a sprite. Whenever I draw the sprite, VStudio always show this message in output panel.

    Thanks for your help




  • 6/12/2009 5:50 PM In reply to

    Re: Dimension Error

    we need to see your rendering code where you set the texture up/bind it to slot 0 ( Effect->SetResources, PSSetShaderResource, etc ), and the shader code to comment.
    http://www.futuregpu.net ex-Aces Lead PM/ex DX SDK PM/ex D3D Evangelist now LRB Launch Native Title Wrangler
Page 1 of 1 (2 items) Previous Next