Moving around some math macros.

This commit is contained in:
Ben Vanik
2014-08-16 17:18:20 -07:00
parent 54ce9db743
commit 5b83cf5fd1
23 changed files with 148 additions and 137 deletions

View File

@@ -9,6 +9,7 @@
#include <xenia/gpu/d3d11/d3d11_geometry_shader.h>
#include <xenia/core/hash.h>
#include <xenia/gpu/gpu-private.h>
#include <xenia/gpu/d3d11/d3d11_shader_resource.h>
#include <xenia/gpu/d3d11/d3d11_shader_translator.h>
@@ -95,7 +96,7 @@ ID3D10Blob* D3D11GeometryShader::Compile(const char* shader_source) {
if (FLAGS_dump_shaders.size()) {
base_path = FLAGS_dump_shaders.c_str();
}
uint64_t hash = xe_hash64(shader_source, strlen(shader_source)); // ?
uint64_t hash = hash64(shader_source, strlen(shader_source)); // ?
char file_name[poly::max_path];
xesnprintfa(file_name, XECOUNT(file_name),
"%s/gen_%.16llX.gs",

View File

@@ -9,6 +9,7 @@
#include <xenia/gpu/d3d11/d3d11_graphics_driver.h>
#include <xenia/core/hash.h>
#include <xenia/gpu/gpu-private.h>
#include <xenia/gpu/buffer_resource.h>
#include <xenia/gpu/shader_resource.h>

View File

@@ -9,6 +9,7 @@
#include <xenia/gpu/d3d11/d3d11_shader_resource.h>
#include <xenia/core/hash.h>
#include <xenia/gpu/gpu-private.h>
#include <xenia/gpu/d3d11/d3d11_geometry_shader.h>
#include <xenia/gpu/d3d11/d3d11_resource_cache.h>
@@ -46,7 +47,7 @@ ID3D10Blob* D3D11ShaderCompile(XE_GPU_SHADER_TYPE type,
if (FLAGS_dump_shaders.size()) {
base_path = FLAGS_dump_shaders.c_str();
}
size_t hash = xe_hash64(disasm_source, strlen(disasm_source)); // ?
size_t hash = hash64(disasm_source, strlen(disasm_source)); // ?
char file_name[poly::max_path];
xesnprintfa(file_name, XECOUNT(file_name),
"%s/gen_%.16llX.%s",

View File

@@ -11,6 +11,7 @@
#include <algorithm>
#include <xenia/core/hash.h>
using namespace std;
using namespace xe;
@@ -108,7 +109,7 @@ VertexBufferResource* ResourceCache::FetchVertexBuffer(
uint64_t ResourceCache::HashRange(const MemoryRange& memory_range) {
// We could do something smarter here to potentially early exit.
return xe_hash64(memory_range.host_base, memory_range.length);
return hash64(memory_range.host_base, memory_range.length);
}
void ResourceCache::SyncRange(uint32_t address, int length) {

View File

@@ -10,6 +10,7 @@
#ifndef XENIA_GPU_SAMPLER_STATE_RESOURCE_H_
#define XENIA_GPU_SAMPLER_STATE_RESOURCE_H_
#include <xenia/core/hash.h>
#include <xenia/gpu/resource.h>
#include <xenia/gpu/xenos/ucode.h>
#include <xenia/gpu/xenos/xenos.h>

View File

@@ -9,6 +9,7 @@
#include <xenia/gpu/texture_resource.h>
#include <poly/math.h>
#include <xenia/gpu/xenos/ucode.h>
#include <xenia/gpu/xenos/xenos.h>
@@ -253,16 +254,16 @@ void TextureResource::Info::CalculateTextureSizes2D(
width_multiple = minimum_multiple;
}
}
size_2d.input_width = XEROUNDUP(size_2d.logical_width, width_multiple);
size_2d.input_height = XEROUNDUP(size_2d.logical_height, 32);
size_2d.input_width = poly::round_up(size_2d.logical_width, width_multiple);
size_2d.input_height = poly::round_up(size_2d.logical_height, 32);
size_2d.output_width = size_2d.logical_width;
size_2d.output_height = size_2d.logical_height;
} else {
// must be 128x128
size_2d.input_width = XEROUNDUP(size_2d.logical_width, 128);
size_2d.input_height = XEROUNDUP(size_2d.logical_height, 128);
size_2d.output_width = XENEXTPOW2(size_2d.logical_width);
size_2d.output_height = XENEXTPOW2(size_2d.logical_height);
size_2d.input_width = poly::round_up(size_2d.logical_width, 128);
size_2d.input_height = poly::round_up(size_2d.logical_height, 128);
size_2d.output_width = poly::next_pow2(size_2d.logical_width);
size_2d.output_height = poly::next_pow2(size_2d.logical_height);
}
size_2d.logical_pitch = (size_2d.logical_width / block_size) * texel_pitch;