Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8177029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:24:18+00:00 2026-06-06T23:24:18+00:00

i was trying to render to a texture to use it for post-processing. I’ve

  • 0

i was trying to render to a texture to use it for post-processing. I’ve read a lot of tutorials about this stuff und have tried it for myself now, but apparently i am doing something wrong. I already was asking another question regarding this topic, but since this question is a differnt one i think it is a better idea to create a new one.
So first of all these are the error message im getting over and over:

D3D11: ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:400,h:300,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:1280,h:720,as:1), while the Resource is a Texture2D with (mc:1,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW ]
D3D11: ERROR: ID3D11DeviceContext::Draw: Rasterization Unit is enabled (PixelShader is not NULL or Depth/Stencil test is enabled and RasterizedStream is not D3D11_SO_NO_RASTERIZED_STREAM) but position is not provided by the last shader before the Rasterization Unit. [ EXECUTION ERROR #362: DEVICE_DRAW_POSITION_NOT_PRESENT ]

And:

D3D11: ERROR: ID3D11DeviceContext::Draw: Vertex Shader - Geometry Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (RADIUS,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]
D3D11: ERROR: ID3D11DeviceContext::Draw: Vertex Shader - Geometry Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (TEXTUREINDEX,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]
D3D11: ERROR: ID3D11DeviceContext::Draw: Geometry Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (POSITION,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]
D3D11: ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:400,h:300,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:1280,h:720,as:1), while the Resource is a Texture2D with (mc:1,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW ]

I am pretty sure that i am misunterstanding a major aspect of this rendertarget switching and stuff.
When my DirectX Device is created i am also creating this:

    D3D11_TEXTURE2D_DESC textureDesc;
    D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc;
    D3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;

    ZeroMemory(&textureDesc, sizeof(textureDesc));

    textureDesc.Width = 800/2;
    textureDesc.Height = 600/2;
    textureDesc.MipLevels = 1;
    textureDesc.ArraySize = 1;
    textureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
    textureDesc.SampleDesc.Count = 1;
    textureDesc.Usage = D3D11_USAGE_DEFAULT;
    textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
    textureDesc.CPUAccessFlags = 0;
    textureDesc.MiscFlags = 0;


    pDevice->CreateTexture2D(&textureDesc, NULL, &renderTargetTextureMap);

    renderTargetViewDesc.Format = textureDesc.Format;
    renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
    renderTargetViewDesc.Texture2D.MipSlice = 0;

    .
    pDevice->CreateRenderTargetView(renderTargetTextureMap, &renderTargetViewDesc, &renderTargetViewMap);

    shaderResourceViewDesc.Format = textureDesc.Format;
    shaderResourceViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
    shaderResourceViewDesc.Texture2D.MostDetailedMip = 0;
    shaderResourceViewDesc.Texture2D.MipLevels = 1;

    pDevice->CreateShaderResourceView(renderTargetTextureMap, &shaderResourceViewDesc, &shaderResourceViewMap);

    D3DVERTEX quad[4] = {
        {D3DXVECTOR3(0,0,0), D3DXVECTOR2(0,0)},
        {D3DXVECTOR3(1,1,0), D3DXVECTOR2(1,1)},
        {D3DXVECTOR3(1,0,0), D3DXVECTOR2(1,0)},
        {D3DXVECTOR3(0,1,0), D3DXVECTOR2(0,1)}};

    HRESULT hr;

    D3D11_SUBRESOURCE_DATA InitData;
    InitData.pSysMem = &quad[0];
    InitData.SysMemPitch = sizeof(D3DVERTEX);
    InitData.SysMemSlicePitch = 0;

    D3D11_BUFFER_DESC bufferDesc;
    bufferDesc.Usage            = D3D11_USAGE_DEFAULT;
    bufferDesc.ByteWidth        = 4 * InitData.SysMemPitch;
    bufferDesc.BindFlags        = D3D11_BIND_VERTEX_BUFFER;
    bufferDesc.CPUAccessFlags   = 0;
    bufferDesc.MiscFlags        = 0;

    V_RETURN(pDevice->CreateBuffer( &bufferDesc, &InitData, &m_pVertexBuffer ));

    const D3D11_INPUT_ELEMENT_DESC layout[] = // http://msdn.microsoft.com/en-us/library/bb205117%28v=vs.85%29.aspx
    {
        { "POSITION",          0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TEXCOORD",          0, DXGI_FORMAT_R32G32_FLOAT,    0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    };
    UINT numElements = sizeof( layout ) / sizeof( layout[0] );
    D3DX11_PASS_DESC passDesc;
    m_pEffect->GetTechniqueByName("Render")->GetPassByName("P0_PP")->GetDesc(&passDesc);

    V_RETURN( pDevice->CreateInputLayout( layout, numElements, passDesc.pIAInputSignature,
              passDesc.IAInputSignatureSize, &m_pInputLayout ) );

So i am creating a ShaderResourceView and a RenderTargetView aswell as a cube with a vertex buffer to draw this cube where the texture will be drawn on.

Now in every frame update after ALL the other stuff was drawn im using this:

    pDevice->GetImmediateContext(&pd3dImmediateContext);
    pd3dImmediateContext->OMSetRenderTargets( 1, &renderTargetViewMap, pDSV );

    pd3dImmediateContext->ClearRenderTargetView(renderTargetViewMap, g_ClearColor);
    ID3D11Buffer* vbs[] = { m_pVertexBuffer, };
    unsigned int strides[] = { sizeof(D3DVERTEX), }, offsets[] = { 0, };

    pd3dImmediateContext->IASetVertexBuffers(0,1, vbs, strides, offsets);
    pd3dImmediateContext->IASetInputLayout(m_pInputLayout);
    pd3dImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);

    //TODO: Move to header file.
    ID3DX11EffectShaderResourceVariable* g_SpriteEV;

    g_SpriteEV = m_pEffect->GetVariableByName("g_PostProcessTex")->AsShaderResource();

    g_SpriteEV->SetResource(shaderResourceViewMap);
    m_pEffect->GetTechniqueByName("Render")->GetPassByName("P0_PP")->Apply(0, pd3dImmediateContext);

    pd3dImmediateContext->Draw(4, 0);   

I have not explicitly created a depthStencilView which i would guess is my main error here. But i have no idea how to create something like this right.
I am pretty much confused about how this all is working in the background…maybe someone cares to explain this.
Am i doing anything right here or is this just wrong? :p

Thanks for anyone who cares to help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:24:20+00:00Added an answer on June 6, 2026 at 11:24 pm

    Think i was able to do it with the help of this tutorial:
    http://www.rastertek.com/dx11tut22.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use FBO to render to texture and then display the texture,
i am trying to render my Scene to a texture to use it in
I'm trying to render to a texture, then draw that texture to the screen
I'm trying to render to a texture (really thought it would be easier than
trying to render the contents of an IFrame in an Asp.Net Application. This is
I am trying to use Three.js to render a cube with 6 different images
I am trying to render to a texture using openGL ES (for iPhone) and
I'm trying to use Direct3D to render 2D graphics, as recommended by everyone since
I'm trying to use a texture atlas in a game program I'm writing in
Im trying to render a non power of 2 texture using a model class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.