mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 07:13:36 +00:00
remove m_ for textures
This commit is contained in:
parent
d27f6c8fa7
commit
bf474f0cdb
@ -290,15 +290,15 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
|
||||
for (u32 i = 0; i < rsx::limits::textures_count; ++i)
|
||||
{
|
||||
if (!m_textures[i].enabled()) continue;
|
||||
size_t w = m_textures[i].width(), h = m_textures[i].height();
|
||||
if (!textures[i].enabled()) continue;
|
||||
size_t w = textures[i].width(), h = textures[i].height();
|
||||
if (!w || !h) continue;
|
||||
|
||||
const u32 texaddr = rsx::get_address(m_textures[i].offset(), m_textures[i].location());
|
||||
const u32 texaddr = rsx::get_address(textures[i].offset(), textures[i].location());
|
||||
|
||||
int format = m_textures[i].format() & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN);
|
||||
int format = textures[i].format() & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN);
|
||||
DXGI_FORMAT dxgiFormat = getTextureDXGIFormat(format);
|
||||
bool is_swizzled = !(m_textures[i].format() & CELL_GCM_TEXTURE_LN);
|
||||
bool is_swizzled = !(textures[i].format() & CELL_GCM_TEXTURE_LN);
|
||||
|
||||
ID3D12Resource *vramTexture;
|
||||
std::unordered_map<u32, ID3D12Resource* >::const_iterator ItRTT = m_rtts.m_renderTargets.find(texaddr);
|
||||
@ -309,12 +309,12 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
vramTexture = ItRTT->second;
|
||||
isRenderTarget = true;
|
||||
}
|
||||
else if (cachedTex != nullptr && (cachedTex->first == TextureEntry(format, w, h, m_textures[i].mipmap())))
|
||||
else if (cachedTex != nullptr && (cachedTex->first == TextureEntry(format, w, h, textures[i].mipmap())))
|
||||
{
|
||||
if (cachedTex->first.m_isDirty)
|
||||
{
|
||||
updateExistingTexture(m_textures[i], cmdlist, m_textureUploadData, cachedTex->second.Get());
|
||||
m_textureCache.protectData(texaddr, texaddr, getTextureSize(m_textures[i]));
|
||||
updateExistingTexture(textures[i], cmdlist, m_textureUploadData, cachedTex->second.Get());
|
||||
m_textureCache.protectData(texaddr, texaddr, getTextureSize(textures[i]));
|
||||
}
|
||||
vramTexture = cachedTex->second.Get();
|
||||
}
|
||||
@ -322,15 +322,15 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
{
|
||||
if (cachedTex != nullptr)
|
||||
getCurrentResourceStorage().m_dirtyTextures.push_back(m_textureCache.removeFromCache(texaddr));
|
||||
ComPtr<ID3D12Resource> tex = uploadSingleTexture(m_textures[i], m_device.Get(), cmdlist, m_textureUploadData);
|
||||
ComPtr<ID3D12Resource> tex = uploadSingleTexture(textures[i], m_device.Get(), cmdlist, m_textureUploadData);
|
||||
vramTexture = tex.Get();
|
||||
m_textureCache.storeAndProtectData(texaddr, texaddr, getTextureSize(m_textures[i]), format, w, h, m_textures[i].mipmap(), tex);
|
||||
m_textureCache.storeAndProtectData(texaddr, texaddr, getTextureSize(textures[i]), format, w, h, textures[i].mipmap(), tex);
|
||||
}
|
||||
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||
srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||
srvDesc.Format = dxgiFormat;
|
||||
srvDesc.Texture2D.MipLevels = m_textures[i].mipmap();
|
||||
srvDesc.Texture2D.MipLevels = textures[i].mipmap();
|
||||
|
||||
switch (format)
|
||||
{
|
||||
@ -357,10 +357,10 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
{
|
||||
|
||||
|
||||
u8 remap_a = m_textures[i].remap() & 0x3;
|
||||
u8 remap_r = (m_textures[i].remap() >> 2) & 0x3;
|
||||
u8 remap_g = (m_textures[i].remap() >> 4) & 0x3;
|
||||
u8 remap_b = (m_textures[i].remap() >> 6) & 0x3;
|
||||
u8 remap_a = textures[i].remap() & 0x3;
|
||||
u8 remap_r = (textures[i].remap() >> 2) & 0x3;
|
||||
u8 remap_g = (textures[i].remap() >> 4) & 0x3;
|
||||
u8 remap_b = (textures[i].remap() >> 6) & 0x3;
|
||||
if (isRenderTarget)
|
||||
{
|
||||
// ARGB format
|
||||
@ -428,10 +428,10 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1
|
||||
};
|
||||
|
||||
u8 remap_a = m_textures[i].remap() & 0x3;
|
||||
u8 remap_r = (m_textures[i].remap() >> 2) & 0x3;
|
||||
u8 remap_g = (m_textures[i].remap() >> 4) & 0x3;
|
||||
u8 remap_b = (m_textures[i].remap() >> 6) & 0x3;
|
||||
u8 remap_a = textures[i].remap() & 0x3;
|
||||
u8 remap_r = (textures[i].remap() >> 2) & 0x3;
|
||||
u8 remap_g = (textures[i].remap() >> 4) & 0x3;
|
||||
u8 remap_b = (textures[i].remap() >> 6) & 0x3;
|
||||
|
||||
srvDesc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(
|
||||
RemapValue[remap_a],
|
||||
@ -459,7 +459,7 @@ size_t D3D12GSRender::UploadTextures(ID3D12GraphicsCommandList *cmdlist)
|
||||
getCurrentResourceStorage().m_samplerDescriptorHeapIndex = 1;
|
||||
getCurrentResourceStorage().m_currentSamplerIndex = 0;
|
||||
}
|
||||
m_device->CreateSampler(&getSamplerDesc(m_textures[i]),
|
||||
m_device->CreateSampler(&getSamplerDesc(textures[i]),
|
||||
CD3DX12_CPU_DESCRIPTOR_HANDLE(getCurrentResourceStorage().m_samplerDescriptorHeap[getCurrentResourceStorage().m_samplerDescriptorHeapIndex]->GetCPUDescriptorHandleForHeapStart())
|
||||
.Offset((UINT)getCurrentResourceStorage().m_currentSamplerIndex + (UINT)usedTexture, g_descriptorStrideSamplers));
|
||||
|
||||
|
@ -1912,7 +1912,7 @@ void GLGSRender::Draw()
|
||||
|
||||
for (u32 i = 0; i < rsx::limits::textures_count; ++i)
|
||||
{
|
||||
if (!m_textures[i].enabled()) continue;
|
||||
if (!textures[i].enabled()) continue;
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + i);
|
||||
checkForGlError("glActiveTexture");
|
||||
@ -1920,7 +1920,7 @@ void GLGSRender::Draw()
|
||||
m_gl_textures[i].Bind();
|
||||
checkForGlError(fmt::format("m_gl_textures[%d].Bind", i));
|
||||
m_program.SetTex(i);
|
||||
m_gl_textures[i].Init(m_textures[i]);
|
||||
m_gl_textures[i].Init(textures[i]);
|
||||
checkForGlError(fmt::format("m_gl_textures[%d].Init", i));
|
||||
}
|
||||
|
||||
|
@ -409,7 +409,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
|
||||
|
||||
case_range(16, NV4097_SET_TEXTURE_CONTROL3, 4);
|
||||
{
|
||||
rsx::texture& tex = m_textures[index];
|
||||
rsx::texture& tex = textures[index];
|
||||
const u32 a0 = ARGS(0);
|
||||
u32 pitch = a0 & 0xFFFFF;
|
||||
u16 depth = a0 >> 20;
|
||||
|
@ -120,7 +120,7 @@ protected:
|
||||
public:
|
||||
GcmTileInfo tiles[rsx::limits::tiles_count];
|
||||
GcmZcullInfo zculls[rsx::limits::zculls_count];
|
||||
rsx::texture m_textures[rsx::limits::textures_count];
|
||||
rsx::texture textures[rsx::limits::textures_count];
|
||||
rsx::vertex_texture m_vertex_textures[rsx::limits::vertex_textures_count];
|
||||
RSXVertexData m_vertex_data[rsx::limits::vertex_count];
|
||||
RSXIndexArrayData m_indexed_array;
|
||||
@ -556,7 +556,7 @@ protected:
|
||||
// Construct Textures
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
m_textures[i] = rsx::texture();
|
||||
textures[i] = rsx::texture();
|
||||
}
|
||||
|
||||
Reset();
|
||||
@ -645,7 +645,7 @@ protected:
|
||||
|
||||
for (uint i = 0; i < rsx::limits::textures_count; ++i)
|
||||
{
|
||||
m_textures[i].init(i);
|
||||
textures[i].init(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,13 +316,13 @@ void RSXDebugger::OnClickBuffer(wxMouseEvent& event)
|
||||
if (event.GetId() == p_buffer_colorD->GetId()) SHOW_BUFFER(3);
|
||||
if (event.GetId() == p_buffer_tex->GetId())
|
||||
{
|
||||
u8 location = render.m_textures[m_cur_texture].location();
|
||||
if(location <= 1 && vm::check_addr(rsx::get_address(render.m_textures[m_cur_texture].offset(), location))
|
||||
&& render.m_textures[m_cur_texture].width() && render.m_textures[m_cur_texture].height())
|
||||
u8 location = render.textures[m_cur_texture].location();
|
||||
if(location <= 1 && vm::check_addr(rsx::get_address(render.textures[m_cur_texture].offset(), location))
|
||||
&& render.textures[m_cur_texture].width() && render.textures[m_cur_texture].height())
|
||||
MemoryViewerPanel::ShowImage(this,
|
||||
rsx::get_address(render.m_textures[m_cur_texture].offset(), location), 1,
|
||||
render.m_textures[m_cur_texture].width(),
|
||||
render.m_textures[m_cur_texture].height(), false);
|
||||
rsx::get_address(render.textures[m_cur_texture].offset(), location), 1,
|
||||
render.textures[m_cur_texture].width(),
|
||||
render.textures[m_cur_texture].height(), false);
|
||||
}
|
||||
|
||||
#undef SHOW_BUFFER
|
||||
@ -453,15 +453,15 @@ void RSXDebugger::GetBuffers()
|
||||
}
|
||||
|
||||
// Draw Texture
|
||||
if(!render.m_textures[m_cur_texture].enabled())
|
||||
if(!render.textures[m_cur_texture].enabled())
|
||||
return;
|
||||
|
||||
u32 offset = render.m_textures[m_cur_texture].offset();
|
||||
u32 offset = render.textures[m_cur_texture].offset();
|
||||
|
||||
if(!offset)
|
||||
return;
|
||||
|
||||
u8 location = render.m_textures[m_cur_texture].location();
|
||||
u8 location = render.textures[m_cur_texture].location();
|
||||
|
||||
if(location > 1)
|
||||
return;
|
||||
@ -473,8 +473,8 @@ void RSXDebugger::GetBuffers()
|
||||
|
||||
unsigned char* TexBuffer = vm::get_ptr<unsigned char>(TexBuffer_addr);
|
||||
|
||||
u32 width = render.m_textures[m_cur_texture].width();
|
||||
u32 height = render.m_textures[m_cur_texture].height();
|
||||
u32 width = render.textures[m_cur_texture].width();
|
||||
u32 height = render.textures[m_cur_texture].height();
|
||||
unsigned char* buffer = (unsigned char*)malloc(width * height * 3);
|
||||
memcpy(buffer, TexBuffer, width * height * 3);
|
||||
|
||||
@ -553,29 +553,29 @@ void RSXDebugger::GetTexture()
|
||||
|
||||
for(uint i=0; i<rsx::limits::textures_count; ++i)
|
||||
{
|
||||
if(render.m_textures[i].enabled())
|
||||
if(render.textures[i].enabled())
|
||||
{
|
||||
m_list_texture->InsertItem(i, wxString::Format("%d", i));
|
||||
u8 location = render.m_textures[i].location();
|
||||
u8 location = render.textures[i].location();
|
||||
if(location > 1)
|
||||
{
|
||||
m_list_texture->SetItem(i, 1,
|
||||
wxString::Format("Bad address (offset=0x%x, location=%d)", render.m_textures[i].offset(), location));
|
||||
wxString::Format("Bad address (offset=0x%x, location=%d)", render.textures[i].offset(), location));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_list_texture->SetItem(i, 1, wxString::Format("0x%x", rsx::get_address(render.m_textures[i].offset(), location)));
|
||||
m_list_texture->SetItem(i, 1, wxString::Format("0x%x", rsx::get_address(render.textures[i].offset(), location)));
|
||||
}
|
||||
|
||||
m_list_texture->SetItem(i, 2, render.m_textures[i].cubemap() ? "True" : "False");
|
||||
m_list_texture->SetItem(i, 3, wxString::Format("%dD", render.m_textures[i].dimension()));
|
||||
m_list_texture->SetItem(i, 4, render.m_textures[i].enabled() ? "True" : "False");
|
||||
m_list_texture->SetItem(i, 5, wxString::Format("0x%x", render.m_textures[i].format()));
|
||||
m_list_texture->SetItem(i, 6, wxString::Format("0x%x", render.m_textures[i].mipmap()));
|
||||
m_list_texture->SetItem(i, 7, wxString::Format("0x%x", render.m_textures[i].pitch()));
|
||||
m_list_texture->SetItem(i, 2, render.textures[i].cubemap() ? "True" : "False");
|
||||
m_list_texture->SetItem(i, 3, wxString::Format("%dD", render.textures[i].dimension()));
|
||||
m_list_texture->SetItem(i, 4, render.textures[i].enabled() ? "True" : "False");
|
||||
m_list_texture->SetItem(i, 5, wxString::Format("0x%x", render.textures[i].format()));
|
||||
m_list_texture->SetItem(i, 6, wxString::Format("0x%x", render.textures[i].mipmap()));
|
||||
m_list_texture->SetItem(i, 7, wxString::Format("0x%x", render.textures[i].pitch()));
|
||||
m_list_texture->SetItem(i, 8, wxString::Format("%dx%d",
|
||||
render.m_textures[i].width(),
|
||||
render.m_textures[i].height()));
|
||||
render.textures[i].width(),
|
||||
render.textures[i].height()));
|
||||
|
||||
m_list_texture->SetItemBackgroundColour(i, wxColour(m_cur_texture == i ? "Wheat" : "White"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user