GRP UI: respect image 0's texture wrap mode

This commit is contained in:
myT 2023-09-26 14:42:00 +02:00
parent 4219dc7698
commit 1258625810
1 changed files with 5 additions and 2 deletions

View File

@ -140,9 +140,12 @@ void UI::DrawBatch()
}
// @TODO: support for custom shaders?
Q_assert(shader->stages[0] != NULL);
const textureBundle_t& bundle = shader->stages[0]->bundle;
const textureWrap_t wrapMode = bundle.image[0] != NULL ? bundle.image[0]->wrapClampMode : TW_REPEAT;
PixelRC pixelRC = {};
pixelRC.texture = GetBundleImage(shader->stages[0]->bundle)->textureIndex;
pixelRC.sampler = GetSamplerIndex(TW_CLAMP_TO_EDGE, TextureFilter::Linear);
pixelRC.texture = GetBundleImage(bundle)->textureIndex;
pixelRC.sampler = GetSamplerIndex(wrapMode, TextureFilter::Linear);
CmdSetRootConstants(rootSignature, ShaderStage::Pixel, &pixelRC);
CmdDrawIndexed(indexCount, firstIndex, 0);