@@ -6,7 +6,6 @@ namespace LatteDecompiler
6
6
{
7
7
auto src = decompilerContext->shaderSource ;
8
8
9
- LatteDecompilerShaderResourceMapping& resourceMapping = decompilerContext->output ->resourceMappingGL ;
10
9
auto & uniformOffsets = decompilerContext->output ->uniformOffsetsVK ;
11
10
12
11
src->add (" struct SupportBuffer {" _CRLF);
@@ -129,11 +128,8 @@ namespace LatteDecompiler
129
128
if (!decompilerContext->analyzer .uniformBufferAccessTracker [i].HasAccess ())
130
129
continue ;
131
130
132
- cemu_assert_debug (decompilerContext->output ->resourceMappingGL .uniformBuffersBindingPoint [i] >= 0 );
133
131
cemu_assert_debug (decompilerContext->output ->resourceMappingVK .uniformBuffersBindingPoint [i] >= 0 );
134
132
135
- // shaderSrc->addFmt("UNIFORM_BUFFER_LAYOUT({}, {}, {}) ", (sint32)decompilerContext->output->resourceMappingGL.uniformBuffersBindingPoint[i], (sint32)decompilerContext->output->resourceMappingVK.setIndex, (sint32)decompilerContext->output->resourceMappingVK.uniformBuffersBindingPoint[i]);
136
-
137
133
shaderSrc->addFmt (" struct UBuff{} {{" _CRLF, i);
138
134
shaderSrc->addFmt (" float4 d[{}];" _CRLF, decompilerContext->analyzer .uniformBufferAccessTracker [i].DetermineSize (decompilerContext->shaderBaseHash , LATTE_GLSL_DYNAMIC_UNIFORM_BLOCK_SIZE));
139
135
shaderSrc->add (" };" _CRLF _CRLF);
@@ -169,9 +165,7 @@ namespace LatteDecompiler
169
165
{
170
166
if (decompilerContext->analyzer .inputAttributSemanticMask [i])
171
167
{
172
- cemu_assert_debug (decompilerContext->output ->resourceMappingGL .attributeMapping [i] >= 0 );
173
168
cemu_assert_debug (decompilerContext->output ->resourceMappingVK .attributeMapping [i] >= 0 );
174
- cemu_assert_debug (decompilerContext->output ->resourceMappingGL .attributeMapping [i] == decompilerContext->output ->resourceMappingVK .attributeMapping [i]);
175
169
176
170
src->addFmt (" uint4 attrDataSem{} [[attribute({})]];" _CRLF, i, (sint32)decompilerContext->output ->resourceMappingVK .attributeMapping [i]);
177
171
}
@@ -304,10 +298,9 @@ namespace LatteDecompiler
304
298
if (!decompilerContext->analyzer .uniformBufferAccessTracker [i].HasAccess ())
305
299
continue ;
306
300
307
- cemu_assert_debug (decompilerContext->output ->resourceMappingGL .uniformBuffersBindingPoint [i] >= 0 );
308
301
cemu_assert_debug (decompilerContext->output ->resourceMappingVK .uniformBuffersBindingPoint [i] >= 0 );
309
302
310
- src->addFmt (" , constant UBuff{}& ubuff{} [[buffer({})]]" , i, i, (sint32)decompilerContext->output ->resourceMappingGL .uniformBuffersBindingPoint [i]);
303
+ src->addFmt (" , constant UBuff{}& ubuff{} [[buffer({})]]" , i, i, (sint32)decompilerContext->output ->resourceMappingVK .uniformBuffersBindingPoint [i]);
311
304
}
312
305
}
313
306
}
@@ -348,11 +341,11 @@ namespace LatteDecompiler
348
341
cemu_assert_unimplemented ();
349
342
}
350
343
351
- // HACK
352
- uint32 textureBinding = shaderContext->output ->resourceMappingGL .textureUnitToBindingPoint [i] % 31 ;
353
- uint32 samplerBinding = textureBinding % 16 ;
354
- src->addFmt (" tex{} [[texture({})]]" , i, textureBinding );
355
- src->addFmt (" , sampler samplr{} [[sampler({})]]" , i, samplerBinding );
344
+ uint32 binding = shaderContext-> output -> resourceMappingVK . textureUnitToBindingPoint [i];
345
+ // uint32 textureBinding = shaderContext->output->resourceMappingVK .textureUnitToBindingPoint[i] % 31;
346
+ // uint32 samplerBinding = textureBinding % 16;
347
+ src->addFmt (" tex{} [[texture({})]]" , i, binding );
348
+ src->addFmt (" , sampler samplr{} [[sampler({})]]" , i, binding );
356
349
}
357
350
}
358
351
0 commit comments