MCPcopy Create free account
hub / github.com/baldurk/renderdoc / QueueSampleGather

Method QueueSampleGather

renderdoc/driver/gl/gl_shaderdebug.cpp:651–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649 }
650
651 bool QueueSampleGather(rdcspv::ThreadState &lane, rdcspv::Op opcode,
652 DebugAPIWrapper::TextureType texType, const ShaderBindIndex &imageBind,
653 const ShaderBindIndex &samplerBind, const ShaderVariable &uv,
654 const ShaderVariable &ddxCalc, const ShaderVariable &ddyCalc,
655 const ShaderVariable &compare, rdcspv::GatherChannel gatherChannel,
656 const rdcspv::ImageOperandsAndParamDatas &operands, ShaderVariable &output,
657 bool &hasResult) override
658 {
659 CHECK_DEVICE_THREAD();
660
661 DebugSampleUBO uniformParams = {};
662
663 const bool buffer = (texType & DebugAPIWrapper::Buffer_Texture) != 0;
664 const bool uintTex = (texType & DebugAPIWrapper::UInt_Texture) != 0;
665 const bool sintTex = (texType & DebugAPIWrapper::SInt_Texture) != 0;
666
667 // fetch the right type of descriptor depending on if we're buffer or not
668 bool valid = true;
669 rdcstr access = StringFormat::Fmt("performing %s operation", ToStr(opcode).c_str());
670 const Descriptor &imageDescriptor = buffer ? GetDescriptor(access, ShaderBindIndex(), valid)
671 : GetDescriptor(access, imageBind, valid);
672 const Descriptor &bufferViewDescriptor = buffer
673 ? GetDescriptor(access, imageBind, valid)
674 : GetDescriptor(access, ShaderBindIndex(), valid);
675
676 // fetch the sampler (if there's no sampler, this will silently return dummy data without
677 // marking invalid
678 const SamplerDescriptor &samplerDescriptor = GetSamplerDescriptor(access, samplerBind, valid);
679
680 // if any descriptor lookup failed, return now
681 if(!valid)
682 {
683 hasResult = false;
684 return false;
685 }
686
687 GLMarkerRegion markerRegion("QueueSampleGather");
688
689 GLResource texture = m_pDriver->GetResourceManager()->GetResource(imageDescriptor.resource);
690 GLResource bufTexture =
691 m_pDriver->GetResourceManager()->GetResource(bufferViewDescriptor.resource);
692 GLResource sampler = m_pDriver->GetResourceManager()->GetResource(samplerDescriptor.object);
693
694 // NULL texture : return 0,0,0,0
695 if(!buffer && (texture.name == 0))
696 {
697 memset(&output.value, 0, sizeof(output.value));
698 hasResult = true;
699 return true;
700 }
701
702 WrappedOpenGL::TextureData &texDetails = m_pDriver->m_Textures[imageDescriptor.resource];
703
704 SamplingProgramConfig config;
705
706 config.resType = SamplingProgramConfig::Float;
707 if(uintTex)
708 config.resType = SamplingProgramConfig::UInt;

Callers

nothing calls this directly

Calls 15

FmtFunction · 0.85
ToStrFunction · 0.85
GetDescriptorFunction · 0.85
ShaderBindIndexClass · 0.85
RDCMAXFunction · 0.85
uintCompFunction · 0.85
setUintCompFunction · 0.85
MakeGLFormatFunction · 0.85
GetBaseFormatFunction · 0.85
GetDataTypeFunction · 0.85
floatCompFunction · 0.85

Tested by

no test coverage detected