Skip to content
Snippets Groups Projects
Commit 88a3c05b authored by ReinUsesLisp's avatar ReinUsesLisp
Browse files

gl_shader_decompiler: Fix TXQ types

TXQ returns integer types. Shaders usually do:

R0 = TXQ(); // => int
R0 = static_cast<float>(R0);

If we don't treat it as an integer, it will cast a binary float value as
float - resulting in a corrupted number.
parent a6d5ff05
No related branches found
No related tags found
No related merge requests found
......@@ -1196,11 +1196,12 @@ private:
switch (meta->element) {
case 0:
case 1:
return "textureSize(" + sampler + ", " + lod + ')' + GetSwizzle(meta->element);
return "itof(int(textureSize(" + sampler + ", " + lod + ')' +
GetSwizzle(meta->element) + "))";
case 2:
return "0";
case 3:
return "textureQueryLevels(" + sampler + ')';
return "itof(textureQueryLevels(" + sampler + "))";
}
UNREACHABLE();
return "0";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment