Constantbuffer now supports single bools

This commit is contained in:
Simon Lübeß
2021-05-30 19:38:08 +02:00
parent ae290936b9
commit 64579f9603
3 changed files with 10 additions and 0 deletions
@@ -27,6 +27,8 @@ namespace GlitchyEngine.Renderer
switch(shaderTypeDescription.Type) switch(shaderTypeDescription.Type)
{ {
case .Bool:
_type = .Bool;
case .Float: case .Float:
_type = .Float; _type = .Float;
default: default:
@@ -59,6 +59,13 @@ namespace GlitchyEngine.Renderer
#endif #endif
} }
public void SetData(bool value)
{
EnsureTypeMatch(1, 1, .Bool);
*(bool*)firstByte = value;
}
public void SetData(float value) public void SetData(float value)
{ {
EnsureTypeMatch(1, 1, .Float); EnsureTypeMatch(1, 1, .Float);
@@ -99,6 +99,7 @@ namespace GlitchyEngine.Renderer
public enum ShaderVariableType public enum ShaderVariableType
{ {
Bool,
Float, Float,
// todo // todo
} }