Giter Club home page Giter Club logo

Comments (4)

mikear69 avatar mikear69 commented on July 17, 2024

These are the same:

//ORIGINAL

mul r2.xyzw, r0.zzzz, cb1[5].xyzw

r2.x = cb1[5].x * r0.z
r2.y = cb1[5].y * r0.z
r2.z = cb1[5].z * r0.z
r2.w = cb1[5].w * r0.z

mad r2.xyzw, r0.yyyy, cb1[4].xyzw, r2.xyzw

r2.x = cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[4].z * r0.y + cb1[5].z * r0.z
r2.w = cb1[4].w * r0.y + cb1[5].w * r0.z

mad r2.xyzw, r0.xxxx, cb1[6].xyzw, r2.xyzw

r2.x = cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z
r2.w = cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z

add r2.xyzw, r2.xywz, cb1[7].xywz

r2.x = cb1[7].x + cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[7].y + cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[7].w + cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z
r2.w = cb1[7].z + cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z

//RECOMPILED

mul r2.xyzw, r0.zzzz, cb1[5].xywz

r2.x = cb1[5].x * r0.z
r2.y = cb1[5].y * r0.z
r2.z = cb1[5].w * r0.z
r2.w = cb1[5].z * r0.z

mad r2.xyzw, r0.yyyy, cb1[4].xywz, r2.xyzw

r2.x = cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[4].w * r0.y + cb1[5].w * r0.z
r2.w = cb1[4].z * r0.y + cb1[5].z * r0.z

mad r2.xyzw, r0.xxxx, cb1[6].xywz, r2.xyzw

r2.x = cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z
r2.w = cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z

add r2.xyzw, r2.xyzw, cb1[7].xywz

r2.x = cb1[7].x + cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[7].y + cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[7].w + cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z
r2.w = cb1[7].z + cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z

//COMPARISON
*Original:
r2.x = cb1[7].x + cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
r2.y = cb1[7].y + cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
r2.z = cb1[7].w + cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z
r2.w = cb1[7].z + cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z

  • Re-Compiled
    r2.x = cb1[7].x + cb1[6].x * r0.x + cb1[4].x * r0.y + cb1[5].x * r0.z
    r2.y = cb1[7].y + cb1[6].y * r0.x + cb1[4].y * r0.y + cb1[5].y * r0.z
    r2.z = cb1[7].w + cb1[6].w * r0.x + cb1[4].w * r0.y + cb1[5].w * r0.z
    r2.w = cb1[7].z + cb1[6].z * r0.x + cb1[4].z * r0.y + cb1[5].z * r0.z

These are the same.

from 3dmigoto.

bo3b avatar bo3b commented on July 17, 2024

Just saw this again recently in Black Ops 3. That swap of of the .xyzw to .xywz I think is an fxc compiler bug, I don't think it's legal.

from 3dmigoto.

DarkStarSword avatar DarkStarSword commented on July 17, 2024

Did it actually cause a problem in Black Ops 3? That looks perfectly legal if the compiler decided to store the coordinate in r2.xywz, which it is perfectly legal to do since that is effectively just four independent temporary registers and it can choose whatever order it likes. If it screwed up something in an output register that would be a totally different matter since the order is defined for those.

Regardless, this doesn't look like a 3DMigoto bug - can we close this?

from 3dmigoto.

DarkStarSword avatar DarkStarSword commented on July 17, 2024

Closing this due to lack of response.

from 3dmigoto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.