mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-01 01:34:48 +12:00
sample textures
This commit is contained in:
parent
b62a14d3ff
commit
3bb1ccd4d8
3 changed files with 72 additions and 6 deletions
|
@ -211,7 +211,7 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::span<const PICA::Ve
|
|||
renderCommandEncoder->setVertexBytes(vertices.data(), vertices.size_bytes(), VERTEX_BUFFER_BINDING_INDEX);
|
||||
|
||||
// Bind resources
|
||||
bindTexturesToSlots();
|
||||
bindTexturesToSlots(renderCommandEncoder);
|
||||
|
||||
// TODO: respect primitive type
|
||||
renderCommandEncoder->drawPrimitives(MTL::PrimitiveTypeTriangle, NS::UInteger(0), NS::UInteger(vertices.size()));
|
||||
|
@ -245,7 +245,7 @@ MTL::Texture* RendererMTL::getTexture(Metal::Texture& tex) {
|
|||
}
|
||||
}
|
||||
|
||||
void RendererMTL::bindTexturesToSlots() {
|
||||
void RendererMTL::bindTexturesToSlots(MTL::RenderCommandEncoder* encoder) {
|
||||
static constexpr std::array<u32, 3> ioBases = {
|
||||
PICA::InternalRegs::Tex0BorderColor,
|
||||
PICA::InternalRegs::Tex1BorderColor,
|
||||
|
@ -269,8 +269,7 @@ void RendererMTL::bindTexturesToSlots() {
|
|||
if (addr != 0) [[likely]] {
|
||||
Metal::Texture targetTex(device, addr, static_cast<PICA::TextureFmt>(format), width, height, config);
|
||||
MTL::Texture* tex = getTexture(targetTex);
|
||||
// TODO: bind the texture
|
||||
Helpers::warn("Wanted to bind texture %p at index %i", tex, i);
|
||||
encoder->setFragmentTexture(tex, i);
|
||||
} else {
|
||||
// TODO: bind a dummy texture?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue