Skip to content

Commit 98f75f0

Browse files
committed
Restrict vs_inst buffer to read-only usage in vertex shader
1 parent 83ef14b commit 98f75f0

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

axmol/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ if(_GLES_PROFILE)
9393
set(AX_GLES_PROFILE ${_GLES_PROFILE} CACHE STRING "")
9494

9595
if(AX_GLES_PROFILE LESS 300)
96-
message(FATAL_ERROR "${MACOSX} Invalid GLES profile ${AX_GLES_PROFILE}, must be 300 or later, default ${_GLES_PROFILE}")
96+
set(AX_GLES_PROFILE ${_GLES_PROFILE} CACHE STRING "" FORCE)
97+
message(AUTHOR_WARNING "Forcing GLES profile to ${_GLES_PROFILE} for OpenGL ES")
9798
endif()
9899
else() # force disable GLES profile
99100
set(AX_GLES_PROFILE 0 CACHE STRING "" FORCE)

axmol/renderer/shaders/unlit_instance.vert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ layout(std140, binding = 0) uniform vs_ub {
1212
};
1313

1414
#if defined(AXSLC_TARGET_MSL)
15-
layout(std140, binding = 1) buffer vs_inst {
15+
layout(std140, binding = 1) readonly buffer vs_inst {
1616
mat4 u_instance[];
1717
};
1818
#endif

tests/cpp-tests/Source/shaders/circle.vs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct instance_data_st {
2323
vec2 pos;
2424
float radius;
2525
};
26-
layout(std140, binding = 1) buffer vs_inst {
26+
layout(std140, binding = 1) readonly buffer vs_inst {
2727
instance_data_st instances[];
2828
};
2929
#endif

tests/cpp-tests/Source/shaders/solid_capsule.vs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct instance_data_st {
2626
float radius;
2727
float len;
2828
};
29-
layout(std140, binding = 1) buffer vs_inst {
29+
layout(std140, binding = 1) readonly buffer vs_inst {
3030
instance_data_st instances[];
3131
};
3232
#endif

tests/cpp-tests/Source/shaders/solid_circle.vs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct instance_data_st {
2424
vec4 color;
2525
float radius;
2626
};
27-
layout(std140, binding = 1) buffer vs_inst {
27+
layout(std140, binding = 1) readonly buffer vs_inst {
2828
instance_data_st instances[];
2929
};
3030
#endif

0 commit comments

Comments
 (0)