Mesa (staging/22.0): r300: Print warning when stubbing derivatives

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 22 04:52:00 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 40f84c4b2505011a5b4432760fdb64f74c1dc011
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=40f84c4b2505011a5b4432760fdb64f74c1dc011

Author: Filip Gawin <filip.gawin at zoho.com>
Date:   Sun Jan 23 17:41:43 2022 +0100

r300: Print warning when stubbing derivatives

Fixes: e1c640c3a43d741719864b35cbf855aa82be0611
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14669>
(cherry picked from commit d48c10fab38217264045064b3f48ecac0c24b7bb)

Stable changes:
 - log*_once doesn't exist in the stable branch so log* was used instead

---

 .pick_status.json                                      | 2 +-
 src/gallium/drivers/r300/compiler/radeon_program_alu.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 3448596a15d..eabf4a807f5 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -228,7 +228,7 @@
         "description": "r300: Print warning when stubbing derivatives",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "e1c640c3a43d741719864b35cbf855aa82be0611"
     },
     {
diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.c b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
index 20de8a51692..da13b773f14 100644
--- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c
+++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
@@ -38,6 +38,7 @@
 #include "radeon_compiler.h"
 #include "radeon_compiler_util.h"
 
+#include "util/log.h"
 
 static struct rc_instruction *emit1(
 	struct radeon_compiler * c, struct rc_instruction * after,
@@ -1094,6 +1095,10 @@ int radeonStubDeriv(struct radeon_compiler* c,
 	inst->U.I.Opcode = RC_OPCODE_MOV;
 	inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000;
 
+	mesa_logw("r300: WARNING: Shader is trying to use derivatives, "
+					"but the hardware doesn't support it. "
+					"Expect possible misrendering (it's not a bug, do not report it).");
+
 	return 1;
 }
 



More information about the mesa-commit mailing list