Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SlimDX D3D11 - Too many view objects.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 CdrTomalak   Members   -  Reputation: 272

Like
0Likes
Like

Posted 19 January 2014 - 05:45 AM

Hi,

 

I've created a 2D game engine, and am now working on a few defects. The most concerning of which is the error:

 

D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS: There are too many unique view objects (-2005139453)

 

I've conducted a code review of my graphics methods.

 

Something I do repeatedly is this, in an example of my game board drawing code:

            testSRV = new SlimDX.Direct3D11.ShaderResourceView(graphics, SB_spriteTexture_blueBlock);

            foreach(TileToDraw tile in wallsToDraw_g)
            {            
                spriteRenderer.Draw(testSRV, tile.origin, new Vector2(rectangleSizeWall.Width,rectangleSizeWall.Height), CoordinateType.Absolute);
            }

            testSRV = new SlimDX.Direct3D11.ShaderResourceView(graphics, SB_spriteTexture_pill);

            foreach(TileToDraw tile in pillsToDraw_g)
            {            
                spriteRenderer.Draw(testSRV, tile.origin, new Vector2(rectangleSizePill.Width,rectangleSizePill.Height), CoordinateType.Absolute);
            }

So here I'm just drawing walls and pills on the game board (originated from pacman). I'm thinking that I should be doing something with the ShaderResourceView after I've used it - such as disposing it. Having tried this after the first foreach section (for walls) I find that the pills are not getting drawn at all. So I'm scratching my head wondering what next?

 

Any ideas? I've spent the last few months working on the game engine so I've not looked into the render methods for a loooong time.

 

Cheers!huh.png

 



Sponsor:

#2 lwm   Members   -  Reputation: 1447

Like
4Likes
Like

Posted 19 January 2014 - 06:48 AM

You shouldn't create new views every frame. Just create them once after loading the textures and dispose of them when you don't need them anymore (probably just before disposing the textures).


current project: Roa


#3 CdrTomalak   Members   -  Reputation: 272

Like
0Likes
Like

Posted 26 January 2014 - 11:24 AM

Thanks Iwm! I went through the code and created a view for each texture as part of initialisation. The error has gone away now. I left the game running on 100 lives and it just keeps on going... smile.png






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS