summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2017-05-25 10:22:33 -0600
committerBrian Paul <brianp@vmware.com>2017-05-26 20:05:30 -0600
commit31ff7bff5af2db13581d2e313f29d4be08f98e3a (patch)
treebf4f5f99e433bace04df330524ccdc00b7b9deeb /src/gallium/drivers/svga/svga_tgsi_vgpu10.c
parent21ddab4a173f585f757586b81542c912cb16bf48 (diff)
svga: document some incorrect VGPU10 shader translation issues
We have a few mistakes in our shader translation code, but the virtual GPU is forgiving. Reviewed-by: Michal Krol <michal@vmware.com> Reviewed-by: Neha Bhende<bhenden@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_tgsi_vgpu10.c')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_vgpu10.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
index 3131444e495..1dd76ccda19 100644
--- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
+++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c
@@ -1030,6 +1030,9 @@ emit_src_register(struct svga_shader_emitter_v10 *emit,
operand0.value = operand1.value = 0;
if (is_prim_id) {
+ /* NOTE: we should be using VGPU10_OPERAND_1_COMPONENT here, but
+ * our virtual GPU accepts this as-is.
+ */
operand0.numComponents = VGPU10_OPERAND_0_COMPONENT;
operand0.operandType = VGPU10_OPERAND_TYPE_INPUT_PRIMITIVEID;
}
@@ -5096,6 +5099,9 @@ emit_sample(struct svga_shader_emitter_v10 *emit,
/* SAMPLE dst, coord(s0), resource, sampler */
begin_emit_instruction(emit);
+ /* NOTE: for non-fragment shaders, we should use VGPU10_OPCODE_SAMPLE_L
+ * with LOD=0. But our virtual GPU accepts this as-is.
+ */
emit_sample_opcode(emit, VGPU10_OPCODE_SAMPLE,
inst->Instruction.Saturate, offsets);
emit_dst_register(emit, get_tex_swizzle_dst(&swz_info));
@@ -5236,6 +5242,9 @@ emit_txp(struct svga_shader_emitter_v10 *emit,
begin_emit_instruction(emit);
if (tgsi_is_shadow_target(target))
+ /* NOTE: for non-fragment shaders, we should use
+ * VGPU10_OPCODE_SAMPLE_C_LZ, but our virtual GPU accepts this as-is.
+ */
opcode = VGPU10_OPCODE_SAMPLE_C;
else
opcode = VGPU10_OPCODE_SAMPLE;