Skip to content

Commit

Permalink
[D3D] Fixed build error in DXShaderReflection.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Feb 1, 2025
1 parent aa82b8d commit dbe5299
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions sources/Renderer/DXCommon/DXShaderReflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "DXShaderReflection.h"
#include <d3dcommon.h>


namespace LLGL
Expand Down Expand Up @@ -64,35 +65,32 @@ UniformType MapD3DShaderScalarTypeToUniformType(D3D_SHADER_VARIABLE_TYPE type)
{
switch (type)
{
case D3D_SVT_BOOL: return UniformType::Bool1;
case D3D_SVT_FLOAT: /*pass*/
case D3D_SVT_FLOAT16: return UniformType::Float1;
case D3D_SVT_INT: return UniformType::Int1;
case D3D_SVT_UINT: return UniformType::UInt1;
default: return UniformType::Undefined;
case D3D_SVT_BOOL: return UniformType::Bool1;
case D3D_SVT_FLOAT: return UniformType::Float1;
case D3D_SVT_INT: return UniformType::Int1;
case D3D_SVT_UINT: return UniformType::UInt1;
default: return UniformType::Undefined;
}
}

UniformType MapD3DShaderVectorTypeToUniformType(D3D_SHADER_VARIABLE_TYPE type, UINT elements)
{
switch (type)
{
case D3D_SVT_BOOL: return MakeUniformVectorType(UniformType::Bool1, elements);
case D3D_SVT_FLOAT: /*pass*/
case D3D_SVT_FLOAT16: return MakeUniformVectorType(UniformType::Float1, elements);
case D3D_SVT_INT: return MakeUniformVectorType(UniformType::Int1, elements);
case D3D_SVT_UINT: return MakeUniformVectorType(UniformType::UInt1, elements);
default: return UniformType::Undefined;
case D3D_SVT_BOOL: return MakeUniformVectorType(UniformType::Bool1, elements);
case D3D_SVT_FLOAT: return MakeUniformVectorType(UniformType::Float1, elements);
case D3D_SVT_INT: return MakeUniformVectorType(UniformType::Int1, elements);
case D3D_SVT_UINT: return MakeUniformVectorType(UniformType::UInt1, elements);
default: return UniformType::Undefined;
}
}

UniformType MapD3DShaderMatrixTypeToUniformType(D3D_SHADER_VARIABLE_TYPE type, UINT rows, UINT cols)
{
switch (type)
{
case D3D_SVT_FLOAT: /*pass*/
case D3D_SVT_FLOAT16: return MakeUniformMatrixType(UniformType::Float2x2, rows, cols);
default: return UniformType::Undefined;
case D3D_SVT_FLOAT: return MakeUniformMatrixType(UniformType::Float2x2, rows, cols);
default: return UniformType::Undefined;
}
}

Expand Down

0 comments on commit dbe5299

Please sign in to comment.