mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
Preliminary HLSL support.
This commit is contained in:
parent
e1e47c64ac
commit
6a43f6757d
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,29 @@
|
|||||||
class VertexElementArray;
|
class VertexElementArray;
|
||||||
class CLP(GraphicsStateGuardian);
|
class CLP(GraphicsStateGuardian);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int vertex_shader;
|
||||||
|
int total_constant_descriptions;
|
||||||
|
D3DXCONSTANT_DESC *constant_description_array;
|
||||||
|
}
|
||||||
|
DX_PARAMETER;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int state;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
DIRECT_3D_VERTEX_SHADER direct_3d_vertex_shader;
|
||||||
|
DIRECT_3D_PIXEL_SHADER direct_3d_pixel_shader;
|
||||||
|
};
|
||||||
|
LPD3DXCONSTANTTABLE constant_table;
|
||||||
|
D3DXCONSTANTTABLE_DESC constant_table_description;
|
||||||
|
|
||||||
|
int total_semantics;
|
||||||
|
D3DXSEMANTIC *semantic_array;
|
||||||
|
}
|
||||||
|
DIRECT_3D_SHADER;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : DXShaderContext9
|
// Class : DXShaderContext9
|
||||||
@ -70,6 +93,7 @@ public:
|
|||||||
string _name;
|
string _name;
|
||||||
|
|
||||||
bool _state;
|
bool _state;
|
||||||
|
bool _cg_shader;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -101,10 +125,12 @@ private:
|
|||||||
struct ShaderAutoBind {
|
struct ShaderAutoBind {
|
||||||
CGparameter parameter;
|
CGparameter parameter;
|
||||||
int value;
|
int value;
|
||||||
|
DX_PARAMETER *dx_parameter;
|
||||||
};
|
};
|
||||||
struct ShaderArgBind {
|
struct ShaderArgBind {
|
||||||
CGparameter parameter;
|
CGparameter parameter;
|
||||||
PT(InternalName) name;
|
PT(InternalName) name;
|
||||||
|
DX_PARAMETER *dx_parameter;
|
||||||
};
|
};
|
||||||
struct ShaderTexBind {
|
struct ShaderTexBind {
|
||||||
CGparameter parameter;
|
CGparameter parameter;
|
||||||
@ -112,17 +138,20 @@ private:
|
|||||||
int stage;
|
int stage;
|
||||||
int desiredtype;
|
int desiredtype;
|
||||||
PT(InternalName) suffix;
|
PT(InternalName) suffix;
|
||||||
|
DX_PARAMETER *dx_parameter;
|
||||||
};
|
};
|
||||||
struct ShaderTransBind {
|
struct ShaderTransBind {
|
||||||
CGparameter parameter;
|
CGparameter parameter;
|
||||||
PT(InternalName) src_name;
|
PT(InternalName) src_name;
|
||||||
PT(InternalName) rel_name;
|
PT(InternalName) rel_name;
|
||||||
int trans_piece;
|
int trans_piece;
|
||||||
|
DX_PARAMETER *dx_parameter;
|
||||||
};
|
};
|
||||||
struct ShaderVarying {
|
struct ShaderVarying {
|
||||||
CGparameter parameter;
|
CGparameter parameter;
|
||||||
PT(InternalName) name;
|
PT(InternalName) name;
|
||||||
int append_uv;
|
int append_uv;
|
||||||
|
DX_PARAMETER *dx_parameter;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CGcontext _cg_context;
|
// CGcontext _cg_context;
|
||||||
@ -147,7 +176,7 @@ private:
|
|||||||
void suggest_cg_profile(const string &vpro, const string &fpro);
|
void suggest_cg_profile(const string &vpro, const string &fpro);
|
||||||
CGprofile parse_cg_profile(const string &id, bool vertex);
|
CGprofile parse_cg_profile(const string &id, bool vertex);
|
||||||
void issue_cg_auto_bind(const ShaderAutoBind &bind, GSG *gsg);
|
void issue_cg_auto_bind(const ShaderAutoBind &bind, GSG *gsg);
|
||||||
bool compile_cg_parameter(CGparameter p);
|
bool compile_cg_parameter(CGparameter p, DX_PARAMETER *dx_parameter);
|
||||||
bool errchk_cg_parameter_words(CGparameter p, int len);
|
bool errchk_cg_parameter_words(CGparameter p, int len);
|
||||||
bool errchk_cg_parameter_direction(CGparameter p, CGenum dir);
|
bool errchk_cg_parameter_direction(CGparameter p, CGenum dir);
|
||||||
bool errchk_cg_parameter_variance(CGparameter p, CGenum var);
|
bool errchk_cg_parameter_variance(CGparameter p, CGenum var);
|
||||||
@ -159,6 +188,15 @@ private:
|
|||||||
void print_cg_compile_errors(const string &file, CGcontext ctx);
|
void print_cg_compile_errors(const string &file, CGcontext ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
DIRECT_3D_SHADER _direct_3d_vertex_shader;
|
||||||
|
DIRECT_3D_SHADER _direct_3d_pixel_shader;
|
||||||
|
int _total_dx_parameters;
|
||||||
|
DX_PARAMETER *_dx_parameter_array;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
void release_resources(void);
|
void release_resources(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user