[Fix] (Diligent/Drawing): Use real type for IBO.

This commit is contained in:
BZLZHH
2025-06-08 18:17:05 +08:00
parent 4dfbc01479
commit c183203264
2 changed files with 6 additions and 3 deletions
@@ -461,7 +461,7 @@ namespace MG_GL::GL {
BuffDesc.Usage = Diligent::USAGE_DYNAMIC;
BuffDesc.BindFlags = Diligent::BIND_VERTEX_BUFFER;
BuffDesc.CPUAccessFlags = Diligent::CPU_ACCESS_WRITE;
if (pBuffer) {
pBuffer->Release();
}
@@ -600,10 +600,9 @@ namespace MG_GL::GL {
MG_Util::Debug::LogD("Preparing to draw indexed for program %u", program);
Diligent::DrawIndexedAttribs drawAttrs;
drawAttrs.IndexType = ConvertGLTypeToDiligent(type);
drawAttrs.NumIndices = count;
drawAttrs.Flags = Diligent::DRAW_FLAG_VERIFY_ALL;
drawAttrs.IndexType = Diligent::VT_UINT32;
drawAttrs.IndexType = ConvertGLTypeToDiligent(type);
MG_Util::Debug::LogD("DrawIndexedAttribs Dump:");
MG_Util::Debug::LogD(" NumIndices: %u", drawAttrs.NumIndices);
MG_Util::Debug::LogD(" IndexType: %d", drawAttrs.IndexType);
@@ -105,6 +105,10 @@ namespace MG_GL::GL {
case GL_FLOAT_VEC2: return Diligent::VT_FLOAT32;
case GL_FLOAT_VEC3: return Diligent::VT_FLOAT32;
case GL_FLOAT_VEC4: return Diligent::VT_FLOAT32;
case GL_SHORT: return Diligent::VT_INT16;
case GL_UNSIGNED_SHORT: return Diligent::VT_UINT16;
case GL_BYTE: return Diligent::VT_INT8;
case GL_UNSIGNED_BYTE: return Diligent::VT_UINT8;
case GL_INT: return Diligent::VT_INT32;
case GL_INT_VEC2: return Diligent::VT_INT32;
case GL_INT_VEC3: return Diligent::VT_INT32;