mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Constantbuffer now supports single bools
This commit is contained in:
@@ -27,6 +27,8 @@ namespace GlitchyEngine.Renderer
|
||||
|
||||
switch(shaderTypeDescription.Type)
|
||||
{
|
||||
case .Bool:
|
||||
_type = .Bool;
|
||||
case .Float:
|
||||
_type = .Float;
|
||||
default:
|
||||
|
||||
@@ -58,6 +58,13 @@ namespace GlitchyEngine.Renderer
|
||||
Log.EngineLogger.Warning($"The types do not match: Expected \"{_type}\" but Received \"{type}\" instead. Variable: \"{_name}\" of buffer: \"{_constantBuffer.Name}\"");
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetData(bool value)
|
||||
{
|
||||
EnsureTypeMatch(1, 1, .Bool);
|
||||
|
||||
*(bool*)firstByte = value;
|
||||
}
|
||||
|
||||
public void SetData(float value)
|
||||
{
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace GlitchyEngine.Renderer
|
||||
|
||||
public enum ShaderVariableType
|
||||
{
|
||||
Bool,
|
||||
Float,
|
||||
// todo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user