diff options
author | Brian Paul <[email protected]> | 2017-05-25 13:46:49 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | 5512f943b87c2ebe01c410cf3af9af8eb31dcb17 (patch) | |
tree | 84a7cff3f81ac7d71899c01d57842895a71042dd | |
parent | 1d806b6f13a7a6abeb9a411ef72f9118e32790ea (diff) |
svga: emit shader version as 4.0 or 4.1 depending on device support
Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index fe24caa62eb..423f215e53f 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -98,6 +98,7 @@ struct svga_shader_emitter_v10 struct svga_compile_key key; struct tgsi_shader_info info; unsigned unit; + unsigned version; /**< Either 40 or 41 at this time */ unsigned inst_start_token; boolean discard_instruction; /**< throw away current instruction? */ @@ -6480,8 +6481,8 @@ emit_vgpu10_header(struct svga_shader_emitter_v10 *emit) VGPU10ProgramToken ptoken; /* First token: VGPU10ProgramToken (version info, program type (VS,GS,PS)) */ - ptoken.majorVersion = 4; - ptoken.minorVersion = 0; + ptoken.majorVersion = emit->version / 10; + ptoken.minorVersion = emit->version % 10; ptoken.programType = translate_shader_type(emit->unit); if (!emit_dword(emit, ptoken.value)) return FALSE; @@ -6611,6 +6612,8 @@ svga_tgsi_vgpu10_translate(struct svga_context *svga, goto done; emit->unit = unit; + emit->version = svga_have_sm4_1(svga) ? 41 : 40; + emit->key = *key; emit->vposition.need_prescale = (emit->key.vs.need_prescale || |