Skip to content

Commit d4edd51

Browse files
Upgraded to latest SPIR-V Cross and removed AMD broken GPU driver row_major workaround (since now that's included in SPIR-V Cross codebase, "lol AMD sux")
1 parent 6787cd3 commit d4edd51

File tree

19 files changed

+22
-134
lines changed

19 files changed

+22
-134
lines changed

3rdparty/spirv_cross

Submodule spirv_cross updated 93 files

examples_tests/03.GPU_Mesh/main.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ struct VertexStruct
2626
const char* vertexSource = R"===(
2727
#version 430 core
2828
29-
#include "irr/builtin/glsl/broken_driver_workarounds/amd.glsl"
30-
3129
layout(location = 0) in vec4 vPos; //only a 3d position is passed from irrlicht, but last (the W) coordinate gets filled with default 1.0
3230
layout(location = 1) in vec4 vCol;
3331
34-
#include <irr/builtin/glsl/broken_driver_workarounds/amd.glsl>
35-
3632
layout( push_constant, row_major ) uniform Block {
3733
mat4 modelViewProj;
3834
} PushConstants;
@@ -41,7 +37,7 @@ layout(location = 0) out vec4 Color; //per vertex output color, will be interpol
4137
4238
void main()
4339
{
44-
gl_Position = irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(PushConstants.modelViewProj)*vPos; //only thing preventing the shader from being core-compliant
40+
gl_Position = PushConstants.modelViewProj*vPos; //only thing preventing the shader from being core-compliant
4541
Color = vCol;
4642
}
4743
)===";

examples_tests/26.MultidrawIndirectVSCPUCull/boxFrustCull.comp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void main()
3030
if (drawID>=pc.data.maxDrawCount)
3131
return;
3232

33-
mat4x3 worldMatrix = irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(modelData[drawID].worldMatrix);
33+
mat4x3 worldMatrix = modelData[drawID].worldMatrix;
3434
mat4 MVP = irr_glsl_pseudoMul4x4with4x3(pc.data.viewProjMatrix,worldMatrix);
3535

3636
bool notCulled = true;
@@ -46,6 +46,6 @@ void main()
4646
if (notCulled)
4747
{
4848
drawData[drawID].modelViewProjMatrix = MVP;
49-
drawData[drawID].normalMatrix = pc.data.viewInverseTransposeMatrix*irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(modelData[drawID].normalMatrix);
49+
drawData[drawID].normalMatrix = pc.data.viewInverseTransposeMatrix*modelData[drawID].normalMatrix;
5050
}
5151
}

examples_tests/26.MultidrawIndirectVSCPUCull/commonVertexShader.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ layout(location = 1) flat out vec3 Normal;
1212

1313
void impl(uint _objectUUID)
1414
{
15-
mat4 mvp = irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(drawData[_objectUUID].modelViewProjMatrix);
15+
mat4 mvp = drawData[_objectUUID].modelViewProjMatrix;
1616

1717
gl_Position = mvp[0]*vPos.x+mvp[1]*vPos.y+mvp[2]*vPos.z+mvp[3];
1818
Color = vec4(0.4,0.4,1.0,1.0);
19-
Normal = normalize(irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(drawData[_objectUUID].normalMatrix)*vNormal); //have to normalize twice because of normal quantization
19+
Normal = normalize(drawData[_objectUUID].normalMatrix*vNormal); //have to normalize twice because of normal quantization
2020
}

examples_tests/29.SpecializationConstants/particles.vert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ layout (set = 0, binding = 0, row_major, std140) uniform UBO
1212

1313
void main()
1414
{
15-
gl_Position = irr_glsl_pseudoMul4x4with3x1(irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(CamData.params.MVP), vPos);
15+
gl_Position = irr_glsl_pseudoMul4x4with3x1(CamData.params.MVP, vPos);
1616
}

examples_tests/35.GeometryCreator/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ layout(location = 3) in vec3 vNormal;
4545
4646
#include <irr/builtin/glsl/utils/common.glsl>
4747
#include <irr/builtin/glsl/utils/transform.glsl>
48-
#include <irr/builtin/glsl/broken_driver_workarounds/amd.glsl>
4948
5049
layout( push_constant, row_major ) uniform Block {
5150
mat4 modelViewProj;
@@ -55,7 +54,7 @@ layout(location = 0) out vec3 Color; //per vertex output color, will be interpol
5554
5655
void main()
5756
{
58-
gl_Position = irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(PushConstants.modelViewProj)*vPos;
57+
gl_Position = PushConstants.modelViewProj*vPos;
5958
Color = vNormal*0.5+vec3(0.5);
6059
}
6160
)===";

examples_tests/42.FragmentShaderPathTracer/common.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ void main()
437437
const vec2 pixOffsetParam = vec2(1.0)/vec2(textureSize(scramblebuf,0));
438438

439439

440-
const mat4 invMVP = inverse(irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(cameraData.params.MVP));
440+
const mat4 invMVP = inverse(cameraData.params.MVP);
441441

442442
vec4 NDC = vec4(TexCoord*vec2(2.0,-2.0)+vec2(-1.0,1.0),0.0,1.0);
443443
vec3 camPos;

include/irr/builtin/glsl/broken_driver_workarounds/amd.glsl

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _IRR_MATH_TYPELESS_ARITHMETIC_INCLUDED_
22
#define _IRR_MATH_TYPELESS_ARITHMETIC_INCLUDED_
33

4+
// TODO: change header name to binary_operator_functions.glsl
5+
46
uint irr_glsl_identityFunction(in uint x) {return x;}
57

68
uint irr_glsl_and(in uint x, in uint y) {return x&y;}
@@ -12,16 +14,8 @@ uint irr_glsl_or(in uint x, in uint y) {return x|y;}
1214

1315
uint irr_glsl_add(in uint x, in uint y) {return x+y;}
1416
float irr_glsl_add(in float x, in float y) {return x+y;}
15-
uint irr_glsl_addAsFloat(in uint x, in uint y) {return floatBitsToUint(uintBitsToFloat(x)+uintBitsToFloat(y));}
1617

1718
uint irr_glsl_mul(in uint x, in uint y) {return x*y;}
1819
float irr_glsl_mul(in float x, in float y) {return x*y;}
19-
uint irr_glsl_mulAsFloat(in uint x, in uint y) {return floatBitsToUint(uintBitsToFloat(x)*uintBitsToFloat(y));}
20-
21-
uint irr_glsl_minAsInt(in uint x, in uint y) {return min(int(x),int(y));}
22-
uint irr_glsl_minAsFloat(in uint x, in uint y) {return floatBitsToUint(min(uintBitsToFloat(x),uintBitsToFloat(y)));}
23-
24-
uint irr_glsl_maxAsInt(in uint x, in uint y) {return max(int(x),int(y));}
25-
uint irr_glsl_maxAsFloat(in uint x, in uint y) {return floatBitsToUint(max(uintBitsToFloat(x),uintBitsToFloat(y)));}
2620

2721
#endif

include/irr/builtin/glsl/utils/common.glsl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef _IRR_BUILTIN_GLSL_UTILS_COMMON_INCLUDED_
22
#define _IRR_BUILTIN_GLSL_UTILS_COMMON_INCLUDED_
33

4-
#include "irr/builtin/glsl/broken_driver_workarounds/amd.glsl"
5-
64
#include "irr/builtin/glsl/math/functions.glsl"
75

86

@@ -15,11 +13,11 @@ struct irr_glsl_SBasicViewParameters
1513

1614
mat3 irr_glsl_SBasicViewParameters_GetNormalMat(in mat4x3 _NormalMatAndEyePos)
1715
{
18-
return mat3(irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(_NormalMatAndEyePos));
16+
return mat3(_NormalMatAndEyePos);
1917
}
2018
vec3 irr_glsl_SBasicViewParameters_GetEyePos(in mat4x3 _NormalMatAndEyePos)
2119
{
22-
return irr_builtin_glsl_workaround_AMD_broken_row_major_qualifier(_NormalMatAndEyePos)[3];
20+
return _NormalMatAndEyePos[3];
2321
}
2422

2523
#endif

0 commit comments

Comments
 (0)