Make XPS happy and remove some GPU address munging.

This commit is contained in:
Ben Vanik
2014-11-02 00:02:17 -07:00
parent 3ed9685244
commit 8c314225bb
7 changed files with 15 additions and 22 deletions

View File

@@ -64,9 +64,6 @@ void CommandProcessor::Initialize(GraphicsDriver* driver,
uint32_t original_size = 1 << (0x1C - page_count - 1);
primary_buffer_size_ = original_size;
read_ptr_index_ = 0;
// Tell the driver what to use for translation.
driver_->set_address_translation(primary_buffer_ptr_ & ~0x1FFFFFFF);
}
void CommandProcessor::EnableReadPointerWriteBack(uint32_t ptr,
@@ -553,7 +550,7 @@ uint32_t CommandProcessor::ExecutePacket(PacketArgs& args) {
// TODO(benvanik): detect subregions of larger index buffers!
uint32_t index_base = READ_PTR();
uint32_t index_size = READ_PTR();
uint32_t endianness = index_size >> 29;
uint32_t endianness = index_size >> 30;
index_size &= 0x00FFFFFF;
bool index_32bit = (d1 >> 11) & 0x1;
index_size *= index_32bit ? 4 : 2;

View File

@@ -53,7 +53,8 @@ int D3D11IndexBufferResource::InvalidateRegion(
SCOPE_profile_cpu_f("gpu");
// All that's done so far:
assert_true(info_.endianness == 0x2);
assert_true(info_.endianness == XE_GPU_ENDIAN_8IN16 ||
info_.endianness == XE_GPU_ENDIAN_8IN32);
D3D11_MAPPED_SUBRESOURCE res;
HRESULT hr = resource_cache_->context()->Map(

View File

@@ -14,13 +14,9 @@ using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::xenos;
GraphicsDriver::GraphicsDriver(Memory* memory) : memory_(memory) {}
GraphicsDriver::GraphicsDriver(Memory* memory) :
memory_(memory), address_translation_(0) {
}
GraphicsDriver::~GraphicsDriver() {
}
GraphicsDriver::~GraphicsDriver() = default;
int GraphicsDriver::LoadShader(XE_GPU_SHADER_TYPE type,
uint32_t address, uint32_t length,
@@ -114,7 +110,6 @@ int GraphicsDriver::PrepareDrawIndexBuffer(
IndexFormat format) {
SCOPE_profile_cpu_f("gpu");
address += address_translation_;
MemoryRange memory_range(memory_->Translate(address), address, length);
IndexBufferResource::Info info;
@@ -209,7 +204,7 @@ int GraphicsDriver::PopulateInputAssembly(DrawCommand& command) {
const auto& info = desc.info;
MemoryRange memory_range;
memory_range.guest_base = (fetch->address << 2) + address_translation_;
memory_range.guest_base = fetch->address << 2;
memory_range.host_base = memory_->Translate(memory_range.guest_base);
memory_range.length = fetch->size * 4;
// TODO(benvanik): if the memory range is within the command buffer, we
@@ -282,7 +277,7 @@ int GraphicsDriver::PopulateSamplerSet(
// TODO(benvanik): quick validate without refetching intraframe.
// Fetch texture from the cache.
MemoryRange memory_range;
memory_range.guest_base = (fetch.address << 12) + address_translation_;
memory_range.guest_base = fetch.address << 12;
memory_range.host_base = memory_->Translate(memory_range.guest_base);
memory_range.length = info.input_length;

View File

@@ -28,9 +28,6 @@ public:
Memory* memory() const { return memory_; }
virtual ResourceCache* resource_cache() const = 0;
RegisterFile* register_file() { return &register_file_; };
void set_address_translation(uint32_t value) {
address_translation_ = value;
}
virtual int Initialize() = 0;
@@ -61,7 +58,6 @@ protected:
Memory* memory_;
RegisterFile register_file_;
uint32_t address_translation_;
VertexShaderResource* vertex_shader_;
PixelShaderResource* pixel_shader_;