mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 22:28:32 +09:00
[Fix]: fix compilation on Windows
This commit is contained in:
@@ -53,12 +53,20 @@
|
|||||||
#include <spirv_cross/spirv_cross_c.h>
|
#include <spirv_cross/spirv_cross_c.h>
|
||||||
|
|
||||||
// Include OpenGL and EGL headers
|
// Include OpenGL and EGL headers
|
||||||
|
#ifdef GLAPI
|
||||||
|
#undef GLAPI
|
||||||
|
#endif
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
|
#include "GL/gl.h"
|
||||||
#include <GL/glcorearb.h>
|
#include <GL/glcorearb.h>
|
||||||
#undef GL_GLEXT_PROTOTYPES
|
#undef GL_GLEXT_PROTOTYPES
|
||||||
|
|
||||||
#include <GL/glext.h>
|
#include <GL/glext.h>
|
||||||
|
|
||||||
|
#define GL_GLES_PROTOTYPES 0
|
||||||
#include <GLES3/gl32.h>
|
#include <GLES3/gl32.h>
|
||||||
|
#undef GL_GLES_PROTOTYPES
|
||||||
|
|
||||||
// Include glslang headers
|
// Include glslang headers
|
||||||
#include <glslang/Include/Types.h>
|
#include <glslang/Include/Types.h>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// End of Source File Header
|
// End of Source File Header
|
||||||
|
|
||||||
#include "TextureEnumConverter.h"
|
#include "TextureEnumConverter.h"
|
||||||
#include "GL/glext.h"
|
|
||||||
#include "MG_Util/Converters/GLToStr/GLEnumConverter.h"
|
#include "MG_Util/Converters/GLToStr/GLEnumConverter.h"
|
||||||
|
|
||||||
namespace MobileGL {
|
namespace MobileGL {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// End of Source File Header
|
// End of Source File Header
|
||||||
|
|
||||||
#include "GLEnumConverter.h"
|
#include "GLEnumConverter.h"
|
||||||
#include <GL/gl.h>
|
|
||||||
|
|
||||||
namespace MobileGL {
|
namespace MobileGL {
|
||||||
namespace MG_Util {
|
namespace MG_Util {
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ namespace MobileGL {
|
|||||||
);
|
);
|
||||||
|
|
||||||
std::vector<Operand> abs_operands;
|
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_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_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, {var_id}});
|
||||||
|
|
||||||
// In GLSL.std.450, `FAbs`'s OpCode == 4
|
// In GLSL.std.450, `FAbs`'s OpCode == 4
|
||||||
// Ref: https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html
|
// 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
|
// 4. build Abs(x) < Epsilon
|
||||||
// OpFOrdLessThan %bool_type %abs_val %eps
|
// OpFOrdLessThan %bool_type %abs_val %eps
|
||||||
std::vector<Operand> less_operands;
|
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_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, {eps_id}});
|
||||||
|
|
||||||
bool isEqualOp = (inst.opcode() == spv::Op::OpFOrdEqual || inst.opcode() == spv::Op::OpFUnordEqual);
|
bool isEqualOp = (inst.opcode() == spv::Op::OpFOrdEqual || inst.opcode() == spv::Op::OpFUnordEqual);
|
||||||
Instruction* less_than_inst = builder.AddInstruction(MakeUnique<Instruction>(
|
Instruction* less_than_inst = builder.AddInstruction(MakeUnique<Instruction>(
|
||||||
|
|||||||
Reference in New Issue
Block a user