From a3a5f07a7ee0c063f36c824ac73a2d6b82d25b8a Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 17 Jan 2025 15:41:54 +0000 Subject: [PATCH] Workaround compile error on old fxc's using .sample on 2DMS texture --- renderdoc/data/hlsl/d3d12_pixelhistory.hlsl | 10 +++++----- renderdoc/data/hlsl/pixelhistory.hlsl | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/renderdoc/data/hlsl/d3d12_pixelhistory.hlsl b/renderdoc/data/hlsl/d3d12_pixelhistory.hlsl index c7455dd46..e2203173d 100644 --- a/renderdoc/data/hlsl/d3d12_pixelhistory.hlsl +++ b/renderdoc/data/hlsl/d3d12_pixelhistory.hlsl @@ -65,19 +65,19 @@ RWBuffer copyout_int : register(u4); { if(copy_depth) { - float val = copyin_depth_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + float val = copyin_depth_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); copyout_depth[dst_slot] = val; } else if(copy_stencil) { - uint val = copyin_stencil_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)].g; + uint val = copyin_stencil_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z).g; copyout_stencil[dst_slot] = val; } else { if(is_float) { - float4 val = copyin_float_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + float4 val = copyin_float_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); copyout_float[dst_slot] = val.x; copyout_float[dst_slot + 1] = val.y; copyout_float[dst_slot + 2] = val.z; @@ -85,7 +85,7 @@ RWBuffer copyout_int : register(u4); } else if(is_uint) { - uint4 val = copyin_uint_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + uint4 val = copyin_uint_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); copyout_uint[dst_slot] = val.x; copyout_uint[dst_slot + 1] = val.y; copyout_uint[dst_slot + 2] = val.z; @@ -93,7 +93,7 @@ RWBuffer copyout_int : register(u4); } else if(is_int) { - int4 val = copyin_int_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + int4 val = copyin_int_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); copyout_int[dst_slot] = val.x; copyout_int[dst_slot + 1] = val.y; copyout_int[dst_slot + 2] = val.z; diff --git a/renderdoc/data/hlsl/pixelhistory.hlsl b/renderdoc/data/hlsl/pixelhistory.hlsl index da3adbafa..4f7d9b514 100644 --- a/renderdoc/data/hlsl/pixelhistory.hlsl +++ b/renderdoc/data/hlsl/pixelhistory.hlsl @@ -70,10 +70,10 @@ RWBuffer copyout_int : register(u3); if(copy_depth || copy_stencil) { float2 val = - float2(copyin_depth_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)].r, -1.0f); + float2(copyin_depth_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z).r, -1.0f); - if(copy_stencil) - val.g = (float)copyin_stencil_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)].g; + if(c opy_stencil) + val.g = (float)copyin_stencil_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z).g; copyout_depth[dst_slot] = float4(val, 0.0f, 0.0f); } @@ -81,16 +81,15 @@ RWBuffer copyout_int : register(u3); { if(is_float) { - copyout_float[dst_slot] = - copyin_float_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + copyout_float[dst_slot] = copyin_float_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); } else if(is_uint) { - copyout_uint[dst_slot] = copyin_uint_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + copyout_uint[dst_slot] = copyin_uint_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); } else if(is_int) { - copyout_int[dst_slot] = copyin_int_ms.sample[src_coord.z][uint3(src_coord.xy, src_coord.w)]; + copyout_int[dst_slot] = copyin_int_ms.Load(uint3(src_coord.xy, src_coord.w), src_coord.z); } } }