mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-08 21:17:50 +00:00
Add True and False tests for bitwise enums
This commit is contained in:
@@ -1123,7 +1123,7 @@ struct GLCommandQueue : IGraphicsCommandQueue {
|
||||
auto pipeline = fmt->m_pipeline.cast<GLShaderPipeline>();
|
||||
for (size_t i = 0; i < pipeline->m_elements.size(); ++i) {
|
||||
const VertexElementDescriptor& desc = pipeline->m_elements[i];
|
||||
if ((desc.semantic & VertexSemantic::Instanced) != VertexSemantic::None)
|
||||
if (True(desc.semantic & VertexSemantic::Instanced))
|
||||
instStride += SEMANTIC_SIZE_TABLE[int(desc.semantic & VertexSemantic::SemanticMask)];
|
||||
else
|
||||
stride += SEMANTIC_SIZE_TABLE[int(desc.semantic & VertexSemantic::SemanticMask)];
|
||||
@@ -1137,7 +1137,7 @@ struct GLCommandQueue : IGraphicsCommandQueue {
|
||||
IGraphicsBuffer* lastEBO = nullptr;
|
||||
for (size_t i = 0; i < pipeline->m_elements.size(); ++i) {
|
||||
const VertexElementDescriptor& desc = pipeline->m_elements[i];
|
||||
IGraphicsBuffer* vbo = (desc.semantic & VertexSemantic::Instanced) != VertexSemantic::None
|
||||
IGraphicsBuffer* vbo = True(desc.semantic & VertexSemantic::Instanced)
|
||||
? fmt->m_instVbo.get()
|
||||
: fmt->m_vbo.get();
|
||||
IGraphicsBuffer* ebo = fmt->m_ibo.get();
|
||||
@@ -1157,7 +1157,7 @@ struct GLCommandQueue : IGraphicsCommandQueue {
|
||||
}
|
||||
glEnableVertexAttribArray(i);
|
||||
int maskedSem = int(desc.semantic & VertexSemantic::SemanticMask);
|
||||
if ((desc.semantic & VertexSemantic::Instanced) != VertexSemantic::None) {
|
||||
if (True(desc.semantic & VertexSemantic::Instanced)) {
|
||||
glVertexAttribPointer(i, SEMANTIC_COUNT_TABLE[maskedSem], SEMANTIC_TYPE_TABLE[maskedSem], GL_TRUE, instStride,
|
||||
(void*)instOffset);
|
||||
glVertexAttribDivisor(i, 1);
|
||||
|
||||
@@ -1944,7 +1944,7 @@ struct VulkanVertexFormat {
|
||||
int semantic = int(elemin->semantic & boo::VertexSemantic::SemanticMask);
|
||||
attribute.location = i;
|
||||
attribute.format = SEMANTIC_TYPE_TABLE[semantic];
|
||||
if ((elemin->semantic & boo::VertexSemantic::Instanced) != boo::VertexSemantic::None) {
|
||||
if (True(elemin->semantic & boo::VertexSemantic::Instanced)) {
|
||||
attribute.binding = 1;
|
||||
attribute.offset = m_instStride;
|
||||
m_instStride += SEMANTIC_SIZE_TABLE[semantic];
|
||||
|
||||
Reference in New Issue
Block a user