Subversion Repository Public Repository

Divide-Framework

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
   Copyright (c) 2016 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef HLSL_H_
#define HLSL_H_

#include "Platform/Video/Shaders/Headers/ShaderProgram.h"

namespace Divide {

class d3dShaderProgram final : public ShaderProgram {
    USE_CUSTOM_ALLOCATOR
   public:
    explicit d3dShaderProgram(GFXDevice& context,
                              const stringImpl& name,
                              const stringImpl& resourceLocation,
                              bool asyncLoad);

    ~d3dShaderProgram();

    bool unload() override;

    bool bind() override;

    bool isBound() const override;
    bool isValid() const override;
    
    // Subroutines
    void SetSubroutines(ShaderType type, const vectorImpl<U32>& indices) const override;
    void SetSubroutine(ShaderType type, U32 index) const override;

    U32 GetSubroutineIndex(ShaderType type, const char* name) const override;

    U32 GetSubroutineUniformLocation(ShaderType type, const char* name) const override;

    U32 GetSubroutineUniformCount(ShaderType type) const override;
    // Uniforms
    void Uniform(const char* ext, U32 value) override;
    void Uniform(const char* ext, I32 value) override;
    void Uniform(const char* ext, F32 value) override;
    void Uniform(const char* ext, const vec2<F32>& value) override;
    void Uniform(const char* ext, const vec2<I32>& value) override;
    void Uniform(const char* ext, const vec3<F32>& value) override;
    void Uniform(const char* ext, const vec3<I32>& value) override;
    void Uniform(const char* ext, const vec4<F32>& value) override;
    void Uniform(const char* ext, const vec4<I32>& value) override;
    void Uniform(const char* ext,
                 const mat3<F32>& value,
                 bool transpose = false) override;
    void Uniform(const char* ext,
                 const mat4<F32>& value,
                 bool transpose = false) override;
    void Uniform(const char* ext, const vectorImpl<I32>& values) override;
    void Uniform(const char* ext, const vectorImpl<F32>& values) override;
    void Uniform(const char* ext, const vectorImpl<vec2<F32> >& values) override;
    void Uniform(const char* ext, const vectorImpl<vec3<F32> >& values) override;
    void Uniform(const char* ext, const vectorImplAligned<vec4<F32> >& values) override;
    void Uniform(const char* ext,
                 const vectorImpl<mat3<F32> >& values,
                 bool transpose = false) override;
    void Uniform(const char* ext,
                 const vectorImplAligned<mat4<F32> >& values,
                 bool transpose = false) override;

    void Uniform(I32 location, U32 value) override;
    void Uniform(I32 location, I32 value) override;
    void Uniform(I32 location, F32 value) override;
    void Uniform(I32 location, const vec2<F32>& value) override;
    void Uniform(I32 location, const vec2<I32>& value) override;
    void Uniform(I32 location, const vec3<F32>& value) override;
    void Uniform(I32 location, const vec3<I32>& value) override;
    void Uniform(I32 location, const vec4<F32>& value) override;
    void Uniform(I32 location, const vec4<I32>& value) override;
    void Uniform(I32 location, const mat3<F32>& value, bool transpose = false) override;
    void Uniform(I32 location, const mat4<F32>& value, bool transpose = false) override;
    void Uniform(I32 location, const vectorImpl<I32>& values) override;
    void Uniform(I32 location, const vectorImpl<F32>& values) override;
    void Uniform(I32 location, const vectorImpl<vec2<F32> >& values) override;
    void Uniform(I32 location, const vectorImpl<vec3<F32> >& values) override;
    void Uniform(I32 location, const vectorImplAligned<vec4<F32> >& values) override;
    void Uniform(I32 location,
                 const vectorImpl<mat3<F32> >& values,
                 bool transpose = false) override;
    void Uniform(I32 location,
                 const vectorImplAligned<mat4<F32> >& values,
                 bool transpose = false) override;
    I32 getUniformLocation(const char* name) override;
    void DispatchCompute(U32 xGroups, U32 yGroups, U32 zGroups) override;

    void SetMemoryBarrier(MemoryBarrierType type) override;

   protected:
    bool load() override;
};

};  // namespace Divide
#endif

Commits for Divide-Framework/trunk/Source Code/Platform/Video/Direct3D/Shaders/Headers/d3dShaderProgram.h

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

718 Diff Diff IonutCava picture IonutCava Thu 02 Jun, 2016 16:02:48 +0000

[IonutCava]
- Code cleanup:
— Rename Framebuffer to RenderTarget. Only OpenGL uses the Framebuffer nomenclature.
— Remove base Shader class as only OpenGL will have separate shaders (and eventually move to pipeline objects) as Direct3D uses FX files and may end up with different structure
— Remove drawBox3D, drawSphere3D and drawLines from GFXDevice class and add them as member functions to the IMPrimitive class (renamed to fromXYZ)
— Pull some elements from SceneManager and move them to standalone classes (W.I.P.)

692 Diff Diff IonutCava picture IonutCava Wed 27 Apr, 2016 16:24:26 +0000

[IonutCava]
- Resource system cleanup:
— Resource name and resource file location (if any) is now passed only via explicit constructors! (ResourceDescriptors already contain this data, so why use setters?)
- Fix a bug with ortho projection matrix calculation (set m[3][3] to 1. this was skipped when the identity() call was changed to zero() in the ortho() function)
— This also fixed text rendering

671 Diff Diff IonutCava picture IonutCava Fri 08 Apr, 2016 16:26:49 +0000

[Ionut]
- Custom memory allocation system part 1:
— Add http://www.codeproject.com/Articles/1089905/A-Custom-STL-std-allocator-Replacement-Improves-Pe
— Add custom allocators to strings and vectors
— Add custom allocators to a few test classes
— No support for aligned memory yet, so vec4<F32> and mat4<F32> vectors use the old allocation system
- Replace more std::async call with our custom task system

669 Diff Diff IonutCava picture IonutCava Mon 04 Apr, 2016 16:15:35 +0000

[IonutCava]
- Move Task creation calls to TaskPool.h
- Allow tasks to use any pool, but default behaviour is to use the Kernel’s main task pool
- Change image transparency check to use the task pool instead of OpenMP
— Perfect place for future parallel_for implementation
- Warning fixes
- Some method renaming for improved readability

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

622 Diff Diff IonutCava picture IonutCava Thu 14 Jan, 2016 17:18:49 +0000

[IonutCava]
- Remove onCameraUpdate call from LightManager and SceneGraph as it’s not needed
- Remove special threading handlers from Resource class as very few derived classes use them for now
— Use ResourceState to check current loading state
- Use insertion sort for particles as most entries should already be sorted from the previous frame
- Use async RenderBin sorting system

619 Diff Diff IonutCava picture IonutCava Fri 08 Jan, 2016 16:23:28 +0000

[IonutCava]
- Memory allocation optimizations
- Large VBO allocation system
- More terrain fixes
- Temporarily disable water and vegetation systems

591 Diff Diff IonutCava picture IonutCava Wed 02 Dec, 2015 17:17:23 +0000

[IonutCava]
- More work on the ForwardPlus renderer
- Singleton cleanup
- First steps for reducing scope of GFXDevice class

590 IonutCava picture IonutCava Tue 01 Dec, 2015 16:37:37 +0000

[IonutCava]
- More work on the ForwardPlus renderer