* Question on IPA on GM107 @ 2018-11-12 23:10 Fernando Sahmkow [not found] ` <CA+MSTo8ZOXbqEMfmz_Cv8gQ90smPNgpkNMWbGRG4uNc6fmDkHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: Fernando Sahmkow @ 2018-11-12 23:10 UTC (permalink / raw) To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW [-- Attachment #1.1: Type: text/plain, Size: 617 bytes --] So I'm trying to track an special value in IPA instruction generation. https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp#L2561 Register on 0x14 (20) is set to some source on "insn->op == OP_PINTERP" I have found while emulation that such value can be set sometimes to FragCoord.w, I don't however know what that value is and how to represent it on glsl. Do you guys know where does that value come from and what it means? -- Atentamente, *Fernando A. Sahmkow* *Móvil*: +584242280286 *Correo*: fsahmkow27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [-- Attachment #1.2: Type: text/html, Size: 1463 bytes --] [-- Attachment #2: Type: text/plain, Size: 154 bytes --] _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <CA+MSTo8ZOXbqEMfmz_Cv8gQ90smPNgpkNMWbGRG4uNc6fmDkHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Question on IPA on GM107 [not found] ` <CA+MSTo8ZOXbqEMfmz_Cv8gQ90smPNgpkNMWbGRG4uNc6fmDkHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-11-13 0:16 ` Ilia Mirkin 0 siblings, 0 replies; 2+ messages in thread From: Ilia Mirkin @ 2018-11-13 0:16 UTC (permalink / raw) To: Fernando Sahmkow; +Cc: nouveau On Mon, Nov 12, 2018 at 6:11 PM Fernando Sahmkow <fsahmkow27@gmail.com> wrote: > > So I'm trying to track an special value in IPA instruction generation. > https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp#L2561 > > Register on 0x14 (20) is set to some source on "insn->op == OP_PINTERP" > > I have found while emulation that such value can be set sometimes to FragCoord.w, I don't however know what that value is and how to represent it on glsl. Do you guys know where does that value come from and what it means? It's for perspective division. If you're doing perspective interpolation, you have to pass in 1/w as that argument (and set the interpolation mode to "mul", which iirc doesn't cause anything to be printed in nvdisasm). Note that there's additional subtlety here ... the hardware will do different things depending on what's in the shader header, as well as on the global "shade model" which can be set to "flat". However if you're converting to GLSL, IPA = perspective interp IPA.PASS = linear interp (i.e. "noperspective" in GLSL) IPA.CONSTANT = flat interp (i.e. "flat" in GLSL) IPA.SC = we use this for gl_Color. I *think* it's only this which is affected by the global "shade model" setting. But don't quote me on this. Now, the contents of the shader header will affect the barycentric coordinates that are computed and are made available to the IPA logic, so you can't have too much disagreement. However if the shader header says "flat", then flat interp is what you'll get no matter the IPA.* mode. We use this feature to deal with a situation where you e.g. have noperspective gl_Color gl_SecondaryColor and then glShadeModel(GL_FLAT) -- this is supposed to only affect the gl_SecondaryColor, since the gl_Color has an explicit interpolation mode, so we just mess with the shader header. You can see some of this at work at https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c#n104 Cheers, -ilia _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-13 0:16 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-11-12 23:10 Question on IPA on GM107 Fernando Sahmkow [not found] ` <CA+MSTo8ZOXbqEMfmz_Cv8gQ90smPNgpkNMWbGRG4uNc6fmDkHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2018-11-13 0:16 ` Ilia Mirkin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.