Skip to content

Commit

Permalink
[dependencies] bumps fork of sokol to hkrn/sokol@900e40b (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkrn committed May 3, 2023
1 parent a0e3780 commit 2c5462c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 162 deletions.
6 changes: 1 addition & 5 deletions emapp/bundle/sokol/sokol_glcore33.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sgx_debug_callback(GLenum source, GLenum type, GLuint eid, GLenum severity, GLsi
_SOKOL_UNUSED(severity);
_SOKOL_UNUSED(length);
_SOKOL_UNUSED(user_param);
SOKOL_LOG(message);
_sg.desc.logger.func("sg", 3, SG_LOGITEM_OK, message, 0, NULL, _sg.desc.logger.user_data);
}
#endif /* SOKOL_DEBUG */

Expand Down Expand Up @@ -65,10 +65,6 @@ sgx_label_image(sg_image image, const char *text)
glObjectLabel(GL_RENDERBUFFER, id, -1, text);
_SG_GL_CHECK_ERROR();
}
else if ((id = ptr->gl.depth_render_buffer) != 0) {
glObjectLabel(GL_RENDERBUFFER, id, -1, text);
_SG_GL_CHECK_ERROR();
}
else if ((id = ptr->gl.tex[ptr->cmn.active_slot]) != 0) {
glObjectLabel(GL_TEXTURE, id, -1, text);
}
Expand Down
136 changes: 0 additions & 136 deletions emapp/bundle/sokol/sokol_gles2.c

This file was deleted.

3 changes: 2 additions & 1 deletion emapp/include/emapp/BaseApplicationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ class BaseApplicationService : private NonCopyable {
static IModalDialog *handleCancelRecordingVideo(void *userData, Project *project);
static void *allocateSGXMemory(size_t size, void *opaque);
static void releaseSGXMemory(void *ptr, void *opaque) NANOEM_DECL_NOEXCEPT;
static void handleSGXMessage(const char *message, void *opaque);
static void handleSGXMessage(const char *tag, uint32_t log_level, uint32_t log_item_id, const char *message_or_null,
uint32_t line_nr, const char *filename_or_null, void *user_data);
static void writeRedoMessage(Nanoem__Application__Command *command, Project *project, Error &error);
static void performRedo(undo_command_t *commandPtr, undo_stack_t *stack, undo_command_t *&commandPtrRef);

Expand Down
13 changes: 4 additions & 9 deletions emapp/include/emapp/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ typedef struct sg_color {

typedef enum sg_backend {
SG_BACKEND_GLCORE33,
SG_BACKEND_GLES2,
SG_BACKEND_GLES3,
SG_BACKEND_D3D11,
SG_BACKEND_METAL_IOS,
Expand Down Expand Up @@ -215,6 +214,7 @@ typedef enum sg_pixel_format {
SG_PIXELFORMAT_RG16SI,
SG_PIXELFORMAT_RG16F,
SG_PIXELFORMAT_RGBA8,
SG_PIXELFORMAT_SRGB8A8,
SG_PIXELFORMAT_RGBA8SN,
SG_PIXELFORMAT_RGBA8UI,
SG_PIXELFORMAT_RGBA8SI,
Expand Down Expand Up @@ -299,6 +299,7 @@ typedef struct sg_limits {
int max_image_array_layers; // max number of layers in SG_IMAGETYPE_ARRAY images
int max_vertex_attrs; // <= SG_MAX_VERTEX_ATTRIBUTES or less (on some GLES2 impls)
int gl_max_vertex_uniform_vectors; // <= GL_MAX_VERTEX_UNIFORM_VECTORS (only on GL backends)
int gl_max_combined_texture_image_units; // <= GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS (only on GL backends)
} sg_limits;

typedef enum sg_resource_state {
Expand Down Expand Up @@ -886,8 +887,6 @@ typedef struct sg_image_info {
uint32_t upd_frame_index; /* frame index of last sg_update_image() */
int num_slots; /* number of renaming-slots for dynamically updated images */
int active_slot; /* currently active write-slot for dynamically updated images */
int width; /* image width */
int height; /* image height */
} sg_image_info;

typedef struct sg_shader_info {
Expand All @@ -902,10 +901,6 @@ typedef struct sg_pass_info {
sg_slot_info slot; /* resource pool slot info */
} sg_pass_info;

typedef struct sg_gl_context_desc {
bool force_gles2;
} sg_gl_context_desc;

typedef struct sg_metal_context_desc {
const void *device;
const void *(*renderpass_descriptor_cb)(void);
Expand Down Expand Up @@ -940,7 +935,6 @@ typedef struct sg_context_desc {
sg_pixel_format color_format;
sg_pixel_format depth_format;
int sample_count;
sg_gl_context_desc gl;
sg_metal_context_desc metal;
sg_d3d11_context_desc d3d11;
sg_wgpu_context_desc wgpu;
Expand All @@ -958,7 +952,8 @@ typedef struct sg_allocator {
} sg_allocator;

typedef struct sg_logger {
void (*log_cb)(const char *message, void *user_data);
void (*log_cb)(const char *tag, uint32_t log_level, uint32_t log_item_id, const char *message_or_null,
uint32_t line_nr, const char *filename_or_null, void *user_data);
void *user_data;
} sg_logger;

Expand Down
2 changes: 1 addition & 1 deletion emapp/resources/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This software uses below libraries.
- [sentry-native](https://github.com/getsentry/sentry-native)
- [MIT](https://github.com/getsentry/sentry-native/blob/ff5bfcf0eb2c47d03eb57a51bdf2e6ad4b8ece10/LICENSE)
- [sokol](https://github.com/hkrn/sokol)
- [zlib](https://github.com/hkrn/sokol/blob/604a144407c1174399c4f16d2dd1dd673b8cfca4/LICENSE)
- [zlib](https://github.com/hkrn/sokol/blob/900e40b71b16e853661cb43869b795d1c489aff0/LICENSE)
- [SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross/)
- [Apache License 2.0](https://github.com/KhronosGroup/SPIRV-Cross/blob/9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1/LICENSE)
- [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools/)
Expand Down
15 changes: 8 additions & 7 deletions emapp/src/BaseApplicationService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5664,23 +5664,24 @@ BaseApplicationService::releaseSGXMemory(void *ptr, void *opaque) NANOEM_DECL_NO
}

void
BaseApplicationService::handleSGXMessage(const char *message, void *opaque)
BaseApplicationService::handleSGXMessage(const char * /* tag */, uint32_t /* log_level */, uint32_t /* log_item_id */,
const char *message_or_null, uint32_t /* line_nr */, const char * /* filename_or_null */, void *user_data)
{
BaseApplicationService *self = static_cast<BaseApplicationService *>(opaque);
uint32_t key = bx::hash<bx::HashMurmur2A>(message);
BaseApplicationService *self = static_cast<BaseApplicationService *>(user_data);
uint32_t key = bx::hash<bx::HashMurmur2A>(message_or_null);
HandledSGXMessageSet::const_iterator it = self->m_handledSGXMessages.find(key);
if (it == self->m_handledSGXMessages.end()) {
if (g_sentryAvailable) {
sentry_value_t breadcrumb = sentry_value_new_breadcrumb(nullptr, message);
sentry_value_t breadcrumb = sentry_value_new_breadcrumb(nullptr, message_or_null);
sentry_value_set_by_key(breadcrumb, "category", sentry_value_new_string("error"));
sentry_add_breadcrumb(breadcrumb);
}
if (message) {
EMLOG_DEBUG("Captured SGX error: message=\"{}\"", message);
if (message_or_null) {
EMLOG_DEBUG("Captured SGX error: message=\"{}\"", message_or_null);
}
self->m_handledSGXMessages.insert(key);
}
SG_INSERT_MARKER(message);
SG_INSERT_MARKER(message_or_null);
}

void
Expand Down
2 changes: 1 addition & 1 deletion macos/Resources/English.lproj/Credits.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ MIT
sokol
}}}
\par}
{\pard \ql \f0 \sa0 \li720 \fi-360 \endash \tx360\tab {\field{\*\fldinst{HYPERLINK "https://github.com/hkrn/sokol/blob/604a144407c1174399c4f16d2dd1dd673b8cfca4/LICENSE"}}{\fldrslt{\ul
{\pard \ql \f0 \sa0 \li720 \fi-360 \endash \tx360\tab {\field{\*\fldinst{HYPERLINK "https://github.com/hkrn/sokol/blob/900e40b71b16e853661cb43869b795d1c489aff0/LICENSE"}}{\fldrslt{\ul
zlib
}}}
\sa180\par}
Expand Down
1 change: 0 additions & 1 deletion sapp/src/ApplicationService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ ApplicationService::handleSetupGraphicsEngine(sg_desc &desc)
context.color_format = static_cast<sg_pixel_format>(sapp_color_format());
context.depth_format = static_cast<sg_pixel_format>(sapp_depth_format());
context.sample_count = sapp_sample_count();
context.gl.force_gles2 = sapp_gles2();
context.metal.device = sapp_metal_get_device();
context.metal.renderpass_descriptor_cb = sapp_metal_get_renderpass_descriptor;
context.metal.drawable_cb = sapp_metal_get_drawable;
Expand Down

0 comments on commit 2c5462c

Please sign in to comment.