summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/kepler_compute.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-25 15:53:18 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-25 15:01:30 +0200
commit33fcec3502f5dd5a99b7a8337128b7c99bfba908 (patch)
tree4f41d09678600fc3e12708f8a4f8ae2f05c37ad1 /src/video_core/engines/kepler_compute.cpp
parentShader_IR: Implement Fast BRX and allow multi-branches in the CFG. (diff)
downloadyuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar.gz
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar.bz2
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar.lz
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar.xz
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.tar.zst
yuzu-33fcec3502f5dd5a99b7a8337128b7c99bfba908.zip
Diffstat (limited to 'src/video_core/engines/kepler_compute.cpp')
-rw-r--r--src/video_core/engines/kepler_compute.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp
index ba97c2894..6f00db1c1 100644
--- a/src/video_core/engines/kepler_compute.cpp
+++ b/src/video_core/engines/kepler_compute.cpp
@@ -78,6 +78,24 @@ u32 KeplerCompute::AccessConstBuffer32(ShaderType stage, u64 const_buffer, u64 o
return result;
}
+SamplerDescriptor KeplerCompute::AccessBoundSampler(ShaderType stage, u64 offset) const {
+ return AccessBindlessSampler(stage, regs.tex_cb_index, offset * sizeof(Texture::TextureHandle));
+}
+
+SamplerDescriptor KeplerCompute::AccessBindlessSampler(ShaderType stage, u64 const_buffer,
+ u64 offset) const {
+ ASSERT(stage == ShaderType::Compute);
+ const auto& tex_info_buffer = launch_description.const_buffer_config[const_buffer];
+ const GPUVAddr tex_info_address =
+ tex_info_buffer.Address() + offset;
+
+ const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)};
+ const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle, offset);
+ SamplerDescriptor result = SamplerDescriptor::FromTicTexture(tex_info.tic.texture_type.Value());
+ result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value());
+ return result;
+}
+
void KeplerCompute::ProcessLaunch() {
const GPUVAddr launch_desc_loc = regs.launch_desc_loc.Address();
memory_manager.ReadBlockUnsafe(launch_desc_loc, &launch_description,