Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 770 vs 771 for /trunk/Source Code/Platform/Video/Headers/GFXDevice.h

Diff revisions: vs.
  @@ -81,7 +81,6 @@
81 81 class GFXDeviceGUI;
82 82 class GFXDeviceKernel;
83 83 class GFXDeviceRenderer;
84 - class GFXDeviceRenderStateBlock;
85 84 };
86 85
87 86 /// Rough around the edges Adapter pattern abstracting the actual rendering API
  @@ -90,9 +89,7 @@
90 89 friend class Attorney::GFXDeviceGUI;
91 90 friend class Attorney::GFXDeviceKernel;
92 91 friend class Attorney::GFXDeviceRenderer;
93 - friend class Attorney::GFXDeviceRenderStateBlock;
94 92 protected:
95 - typedef hashMapImpl<size_t, RenderStateBlock> RenderStateMap;
96 93 typedef std::stack<vec4<I32>> ViewportStack;
97 94
98 95 public:
  @@ -335,9 +332,6 @@
335 332 inline void setClipPlanes(const PlaneList& clipPlanes);
336 333 /// clear all clipping planes
337 334 inline void resetClipPlanes();
338 - /// Retrieve a state block by hash value.
339 - /// If the hash value doesn't exist in the state block map, return the default state block
340 - const RenderStateBlock& getRenderStateBlock(size_t renderStateBlockHash) const;
341 335
342 336 /// Generate a cubemap from the given position
343 337 /// It renders the entire scene graph (with culling) as default
  @@ -457,11 +451,6 @@
457 451
458 452 inline RenderStage setRenderStage(RenderStage stage);
459 453
460 - void submitCommand(const GenericDrawCommand& cmd,
461 - bool useIndirectRender = false);
462 -
463 - inline void submitCommands(const vectorImpl<GenericDrawCommand>& cmds,
464 - bool useIndirectRender = false);
465 454 public:
466 455 IMPrimitive* newIMP() const;
467 456 VertexBuffer* newVB() const;
  @@ -498,11 +487,10 @@
498 487 void setBaseViewport(const vec4<I32>& viewport);
499 488
500 489 inline void drawText(const TextLabel& text,
501 - size_t stateHash,
502 - const vec2<F32>& position) {
490 + const vec2<F32>& position,
491 + size_t stateHash) {
503 492 uploadGPUBlock();
504 - setStateBlock(stateHash);
505 - _api->drawText(text, position);
493 + _api->drawText(text, position, stateHash);
506 494 }
507 495
508 496 void drawDebugAxis(const SceneRenderState& sceneRenderState);
  @@ -549,17 +537,9 @@
549 537 void previewDepthBuffer();
550 538 void updateViewportInternal(const vec4<I32>& viewport);
551 539 void updateViewportInternal(I32 x, I32 y, I32 width, I32 height);
552 - /// returns false if there was an invalid state detected that could prevent
553 - /// rendering
554 - bool setBufferData(const GenericDrawCommand& cmd);
555 540 /// Upload draw related data to the GPU (view & projection matrices, viewport settings, etc)
556 541 void uploadGPUBlock();
557 542
558 - /// If the stateBlock doesn't exist in the state block map, add it for future reference
559 - bool registerRenderStateBlock(const RenderStateBlock& stateBlock);
560 -
561 - /// Sets the current state block to the one passed as a param
562 - size_t setStateBlock(size_t stateBlockHash);
563 543 ErrorCode createAPIInstance();
564 544
565 545 NodeData& processVisibleNode(const SceneGraphNode& node, U32 dataIndex);
  @@ -593,10 +573,7 @@
593 573 /* Rendering buffers.*/
594 574 GFXRTPool _rtPool;
595 575 /*State management */
596 - RenderStateMap _stateBlockMap;
597 576 bool _stateBlockByDescription;
598 - size_t _currentStateBlockHash;
599 - size_t _previousStateBlockHash;
600 577 size_t _defaultStateBlockHash;
601 578 /// The default render state buth with depth testing disabled
602 579 size_t _defaultStateNoDepthHash;
  @@ -664,22 +641,13 @@
664 641 static void drawText(const TextLabel& text,
665 642 size_t stateHash,
666 643 const vec2<F32>& position) {
667 - return GFXDevice::instance().drawText(text, stateHash, position);
644 + return GFXDevice::instance().drawText(text, position, stateHash);
668 645 }
669 646
670 647 friend class Divide::GUI;
671 648 friend class Divide::GUIText;
672 649 };
673 650
674 - class GFXDeviceRenderStateBlock {
675 - private:
676 - static bool registerStateBlock(const RenderStateBlock& block) {
677 - return GFXDevice::instance().registerRenderStateBlock(block);
678 - }
679 -
680 - friend class Divide::RenderStateBlock;
681 - };
682 -
683 651 class GFXDeviceKernel {
684 652 private:
685 653 static void onCameraUpdate(Camera& camera) {