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)
|
switch(shaderTypeDescription.Type)
|
||||||
{
|
{
|
||||||
|
case .Bool:
|
||||||
|
_type = .Bool;
|
||||||
case .Float:
|
case .Float:
|
||||||
_type = .Float;
|
_type = .Float;
|
||||||
default:
|
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}\"");
|
Log.EngineLogger.Warning($"The types do not match: Expected \"{_type}\" but Received \"{type}\" instead. Variable: \"{_name}\" of buffer: \"{_constantBuffer.Name}\"");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetData(bool value)
|
||||||
|
{
|
||||||
|
EnsureTypeMatch(1, 1, .Bool);
|
||||||
|
|
||||||
|
*(bool*)firstByte = value;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetData(float value)
|
public void SetData(float value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ namespace GlitchyEngine.Renderer
|
|||||||
|
|
||||||
public enum ShaderVariableType
|
public enum ShaderVariableType
|
||||||
{
|
{
|
||||||
|
Bool,
|
||||||
Float,
|
Float,
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user