Skip to content

Commit 7ee4a3b

Browse files
committed
Fixed: OpenGL 1 and 3 compatibility types and fixed bitmaptext.glsl layout
1 parent 6c01c0e commit 7ee4a3b

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

modules/renderer/backends/gl/hip/hiprenderer/backend/gl/glshader.d

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ class Hip_GL_ShaderImpl : IShader
187187
#elif defined(VERTEX)
188188
#define ATTRIBUTE(LOC) attribute
189189
#endif
190+
191+
#define UVEC2 vec2
192+
#define UINT float
190193
#else
191194
#define IN in
192195
#define OUT out
@@ -201,6 +204,10 @@ class Hip_GL_ShaderImpl : IShader
201204
#define INOUT OUT
202205
#define ATTRIBUTE(LOC) layout (location = LOC) in
203206
#endif
207+
208+
#define UVEC2 uvec2
209+
#define UINT uint
210+
204211
#endif
205212
206213
#ifdef FRAGMENT

modules/renderer/shaders/opengl/bitmaptext.glsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
INOUT vec2 inTexST;
22
#ifdef VERTEX
3-
ATTRIBUTE(0) uvec2 vPosition;
4-
ATTRIBUTE(1) uint vZ;
5-
ATTRIBUTE(2) vec2 vTexST;
3+
4+
ATTRIBUTE(0) UVEC2 vPosition;
5+
ATTRIBUTE(1) vec2 vTexST;
6+
ATTRIBUTE(2) UINT vZ;
67

78
UNIFORM_BUFFER_OBJECT(0, Cbuf, cbuf,
89
{

modules/renderer/source/hip/hiprenderer/vertex.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private ref HipVertexAttributeInfo appendAttributeField(return ref HipVertexAttr
217217
isNormalized: isNormalized
218218
);
219219

220-
// if(!isPadding)
220+
if(!isPadding)
221221
{
222222
info.fields~= field;
223223
info.dataCount+= count;

modules/util/source/hip/util/conv.d

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,7 @@ TO to(TO, FROM)(FROM f) pure nothrow
163163
else
164164
return toString(f);
165165
}
166-
else static if(is(TO == int) || is(TO == long) || is(TO == short) || is(TO == byte))
167-
{
168-
long ret;
169-
static if(!is(FROM == string))
170-
ret = toInt(f.toString);
171-
else
172-
ret = toInt(f);
173-
assert(ret <= TO.max, "The value overflows the maximum of "~TO.stringof);
174-
assert(ret >= TO.min, "The value underflows the minimum of "~TO.stringof);
175-
return cast(TO)ret;
176-
}
177-
else static if(is(TO == uint) || is(TO == ulong) || is(TO == ubyte) || is(TO == ushort))
166+
else static if(__traits(isIntegral, TO))
178167
{
179168
long ret;
180169
static if(__traits(isFloating, FROM))
@@ -186,7 +175,7 @@ TO to(TO, FROM)(FROM f) pure nothrow
186175
else
187176
ret = toInt(f);
188177
assert(ret <= TO.max, "The value overflows the maximum of "~TO.stringof);
189-
assert(ret >= 0, "The value received is not unsigned. ");
178+
assert(ret >= TO.min, "The value underflows the minimum of "~TO.stringof);
190179
return cast(TO)ret;
191180
}
192181
else static if(is(TO == float) || is(TO == double))

source/hip/graphics/g2d/textrenderer.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public import hip.api.graphics.text : HipTextAlign, Size;
2727
short2 vPosition;
2828
@HipShaderInputNormalized ushort[2] vTexST;
2929
short vZ;
30-
short padding; //Ignore that.
30+
@HipShaderInputPadding short padding; //Ignore that.
3131

3232
static enum size_t quadsCount = HipTextRendererVertex.sizeof*4;
3333
}

0 commit comments

Comments
 (0)