[Fix]: fix compilation on Windows

This commit is contained in:
2026-01-25 11:27:51 +08:00
parent 0b4014d665
commit 639ec18a50
4 changed files with 13 additions and 7 deletions
+8
View File
@@ -53,12 +53,20 @@
#include <spirv_cross/spirv_cross_c.h>
// Include OpenGL and EGL headers
#ifdef GLAPI
#undef GLAPI
#endif
#include <EGL/egl.h>
#define GL_GLEXT_PROTOTYPES
#include "GL/gl.h"
#include <GL/glcorearb.h>
#undef GL_GLEXT_PROTOTYPES
#include <GL/glext.h>
#define GL_GLES_PROTOTYPES 0
#include <GLES3/gl32.h>
#undef GL_GLES_PROTOTYPES
// Include glslang headers
#include <glslang/Include/Types.h>
@@ -7,7 +7,6 @@
// End of Source File Header
#include "TextureEnumConverter.h"
#include "GL/glext.h"
#include "MG_Util/Converters/GLToStr/GLEnumConverter.h"
namespace MobileGL {
@@ -7,7 +7,6 @@
// End of Source File Header
#include "GLEnumConverter.h"
#include <GL/gl.h>
namespace MobileGL {
namespace MG_Util {
@@ -107,9 +107,9 @@ namespace MobileGL {
);
std::vector<Operand> abs_operands;
abs_operands.push_back({spv_operand_type_t::SPV_OPERAND_TYPE_ID, {glsl_std_450_id}});
abs_operands.push_back({spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {4}}); // 4 is FAbs
abs_operands.push_back({spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}});
abs_operands.push_back({SPV_OPERAND_TYPE_ID, {glsl_std_450_id}});
abs_operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {4}}); // 4 is FAbs
abs_operands.push_back({SPV_OPERAND_TYPE_ID, {var_id}});
// In GLSL.std.450, `FAbs`'s OpCode == 4
// Ref: https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html
@@ -124,8 +124,8 @@ namespace MobileGL {
// 4. build Abs(x) < Epsilon
// OpFOrdLessThan %bool_type %abs_val %eps
std::vector<Operand> less_operands;
less_operands.push_back({spv_operand_type_t::SPV_OPERAND_TYPE_ID, {abs_inst->result_id()}});
less_operands.push_back({spv_operand_type_t::SPV_OPERAND_TYPE_ID, {eps_id}});
less_operands.push_back({SPV_OPERAND_TYPE_ID, {abs_inst->result_id()}});
less_operands.push_back({SPV_OPERAND_TYPE_ID, {eps_id}});
bool isEqualOp = (inst.opcode() == spv::Op::OpFOrdEqual || inst.opcode() == spv::Op::OpFUnordEqual);
Instruction* less_than_inst = builder.AddInstruction(MakeUnique<Instruction>(