summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-11-29 11:28:10 -0700
committerBrian Paul <[email protected]>2018-09-10 13:07:30 -0600
commit1ea9c80d6d0b3093d8dfa93a5bf93e4d10bf6406 (patch)
treee33499cb416b5a85a79c70697cad1f403afabc7d /src/gallium/drivers/svga
parent96ef81e39ebb6244b9caad411cdf433eea55a3a3 (diff)
svga: add some devcap debugging code
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_format.c193
1 files changed, 193 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c
index 35f0693323b..79b0c769b04 100644
--- a/src/gallium/drivers/svga/svga_format.c
+++ b/src/gallium/drivers/svga/svga_format.c
@@ -1595,6 +1595,190 @@ check_format_tables(void)
}
+/**
+ * Return string name of an SVGA3dDevCapIndex value.
+ * For debugging.
+ */
+static const char *
+svga_devcap_name(SVGA3dDevCapIndex cap)
+{
+ static const struct debug_named_value devcap_names[] = {
+ /* Note, we only list the DXFMT devcaps so far */
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_X8R8G8B8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_A8R8G8B8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R5G6B5),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_X1R5G5B5),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_A1R5G5B5),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_A4R4G4B4),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_Z_D32),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_Z_D16),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_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AMED_VALUE(SVGA3D_DEVCAP_DXFMT_A2W10V10U10),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_ALPHA8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R_S10E5),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R_S23E8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_RG_S10E5),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_RG_S23E8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BUFFER),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_Z_D24X8),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_V16U16),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_G16R16),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_A16B16G16R16),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_UYVY),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_YUY2),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_NV12),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_AYUV),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32_FLOAT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32B32_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G32_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_X32_TYPELESS_G8X24_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM_SRGB),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16G16_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_D32_FLOAT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R32_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_X24_TYPELESS_G8_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R8G8_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_TYPELESS),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_UINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_SNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_SINT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_D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ED_VALUE(SVGA3D_DEVCAP_DXFMT_R16_FLOAT),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_D16_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_A8_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BC1_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BC2_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BC3_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_B5G6R5_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_B5G5R5A1_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BC4_UNORM),
+ DEBUG_NAMED_VALUE(SVGA3D_DEVCAP_DXFMT_BC5_UNORM),
+ DEBUG_NAMED_VALUE_END,
+ };
+ return debug_dump_enum(devcap_names, cap);
+}
+
+
+/**
+ * Return string for a bitmask of name of SVGA3D_DXFMT_x flags.
+ * For debugging.
+ */
+static const char *
+svga_devcap_format_flags(unsigned flags)
+{
+ static const struct debug_named_value devcap_flags[] = {
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_SUPPORTED),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_SHADER_SAMPLE),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_COLOR_RENDERTARGET),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_DEPTH_RENDERTARGET),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_BLENDABLE),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_MIPS),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_ARRAY),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_VOLUME),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_DX_VERTEX_BUFFER),
+ DEBUG_NAMED_VALUE(SVGA3D_DXFMT_MULTISAMPLE),
+ DEBUG_NAMED_VALUE_END
+ };
+
+ return debug_dump_flags(devcap_flags, flags);
+}
+
+
/*
* Get format capabilities from the host. It takes in consideration
* deprecated/unsupported formats, and formats which are implicitely assumed to
@@ -1625,6 +1809,15 @@ svga_get_format_cap(struct svga_screen *ss,
/* Explicitly advertised format */
if (entry->devcap > SVGA3D_DEVCAP_DXCONTEXT) {
/* Translate DX/VGPU10 format cap to VGPU9 cap */
+
+ if (0) {
+ debug_printf("format %s, devcap %s, value 0x%x (%s)\n",
+ svga_format_name(format),
+ svga_devcap_name(entry->devcap),
+ result.u,
+ svga_devcap_format_flags(result.u));
+ }
+
caps->value = 0;
if (result.u & SVGA3D_DXFMT_COLOR_RENDERTARGET)
caps->value |= SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET;