This commit is contained in:
scribam 2018-04-29 08:41:51 +02:00 committed by Ivan
parent fc23243d01
commit 04ad49de4d
48 changed files with 117 additions and 118 deletions

View file

@ -134,7 +134,7 @@ s32 cellMouseGetData(u32 port_no, vm::ptr<CellMouseData> data)
s32 cellMouseGetDataList(u32 port_no, vm::ptr<CellMouseDataList> data) s32 cellMouseGetDataList(u32 port_no, vm::ptr<CellMouseDataList> data)
{ {
sys_io.todo("cellMouseGetDataList(port_no=%d, data=0x%x", port_no, data); sys_io.todo("cellMouseGetDataList(port_no=%d, data=0x%x)", port_no, data);
if (g_cfg.io.mouse == mouse_handler::null) if (g_cfg.io.mouse == mouse_handler::null)
return CELL_MOUSE_ERROR_NO_DEVICE; return CELL_MOUSE_ERROR_NO_DEVICE;
else else

View file

@ -87,7 +87,6 @@ s32 cellRtcGetTick(vm::ptr<CellRtcDateTime> pTime, vm::ptr<CellRtcTick> pTick)
{ {
cellRtc.todo("cellRtcGetTick(pTime=*0x%x, pTick=*0x%x)", pTime, pTick); cellRtc.todo("cellRtcGetTick(pTime=*0x%x, pTick=*0x%x)", pTime, pTick);
return CELL_OK; return CELL_OK;
} }

View file

@ -242,7 +242,7 @@ std::tuple<u16, u16> PadHandlerBase::ConvertToSquirclePoint(u16 inX, u16 inY, in
// https://thatsmaths.com/2016/07/14/squircles/ // https://thatsmaths.com/2016/07/14/squircles/
const f32 newLen = (1 + std::pow(std::sin(2 * angle), 2.f) / (float(squircle_factor) / 1000.f)) * r; const f32 newLen = (1 + std::pow(std::sin(2 * angle), 2.f) / (float(squircle_factor) / 1000.f)) * r;
// we now have len and angle, convert to cartisian // we now have len and angle, convert to cartesian
const int newX = Clamp0To255(((newLen * std::cos(angle)) + 1) * 127.5f); const int newX = Clamp0To255(((newLen * std::cos(angle)) + 1) * 127.5f);
const int newY = Clamp0To255(((newLen * std::sin(angle)) + 1) * 127.5f); const int newY = Clamp0To255(((newLen * std::sin(angle)) + 1) * 127.5f);
return std::tuple<u16, u16>(newX, newY); return std::tuple<u16, u16>(newX, newY);

View file

@ -62,10 +62,10 @@ public:
// Unmap address (please specify only starting point, no midway memory will be unmapped), returns the size of the unmapped area // Unmap address (please specify only starting point, no midway memory will be unmapped), returns the size of the unmapped area
bool UnmapAddress(u32 addr, u32& size); bool UnmapAddress(u32 addr, u32& size);
// Reserve a certain amount so no one can use it, returns true on succces, false on failure // Reserve a certain amount so no one can use it, returns true on success, false on failure
bool Reserve(u32 size); bool Reserve(u32 size);
// Unreserve a certain amount of bytes, returns true on succcess, false if size is bigger than the reserved amount // Unreserve a certain amount of bytes, returns true on success, false if size is bigger than the reserved amount
bool Unreserve(u32 size); bool Unreserve(u32 size);
// Return the total amount of reserved memory // Return the total amount of reserved memory

View file

@ -363,7 +363,7 @@ namespace rsx
u32 dst_dma = 0; u32 dst_dma = 0;
rsx::blit_engine::transfer_destination_format dst_color_format; rsx::blit_engine::transfer_destination_format dst_color_format;
u32 out_pitch = 0; u32 out_pitch = 0;
u32 out_aligment = 64; u32 out_alignment = 64;
switch (method_registers.blit_engine_context_surface()) switch (method_registers.blit_engine_context_surface())
{ {
@ -372,7 +372,7 @@ namespace rsx
dst_offset = method_registers.blit_engine_output_offset_nv3062(); dst_offset = method_registers.blit_engine_output_offset_nv3062();
dst_color_format = method_registers.blit_engine_nv3062_color_format(); dst_color_format = method_registers.blit_engine_nv3062_color_format();
out_pitch = method_registers.blit_engine_output_pitch_nv3062(); out_pitch = method_registers.blit_engine_output_pitch_nv3062();
out_aligment = method_registers.blit_engine_output_alignment_nv3062(); out_alignment = method_registers.blit_engine_output_alignment_nv3062();
break; break;
case blit_engine::context_surface::swizzle2d: case blit_engine::context_surface::swizzle2d:

View file

@ -123,7 +123,7 @@ namespace rsx
{ {
if (count != 0) if (count != 0)
{ {
// todo: support memory state in the middle of incrememented command // todo: support memory state in the middle of incremented command
// This shouldn't ever happen as long as captures stay in 'strict' aka non-multidraw mode // This shouldn't ever happen as long as captures stay in 'strict' aka non-multidraw mode
fmt::throw_exception("capture replay: state change not supported between increment commands"); fmt::throw_exception("capture replay: state change not supported between increment commands");
} }

View file

@ -124,7 +124,7 @@ namespace rsx
} }
}; };
// bleh, may need to break these out, might be unneccessary to do both always // bleh, may need to break these out, might be unnecessary to do both always
struct tile_state struct tile_state
{ {
tile_info tiles[15]; tile_info tiles[15];

View file

@ -469,7 +469,7 @@ void CgBinaryDisasm::TaskFP()
if (dst.end) if (dst.end)
{ {
m_arb_shader.pop_back(); m_arb_shader.pop_back();
m_arb_shader += " # last inctruction\nEND\n"; m_arb_shader += " # last instruction\nEND\n";
break; break;
} }

View file

@ -26,7 +26,7 @@ typedef struct CgBinaryProgram CgBinaryProgram;
// fragment programs have their constants embedded in the microcode // fragment programs have their constants embedded in the microcode
struct CgBinaryEmbeddedConstant struct CgBinaryEmbeddedConstant
{ {
be_t<u32> ucodeCount; // occurances be_t<u32> ucodeCount; // occurrences
be_t<u32> ucodeOffset[1]; // offsets that need to be patched follow be_t<u32> ucodeOffset[1]; // offsets that need to be patched follow
}; };
@ -76,7 +76,7 @@ struct CgBinaryFragmentProgram
be_t<u16> texCoordsCentroid; // tex coords that are centroid (tex<n> is bit n) be_t<u16> texCoordsCentroid; // tex coords that are centroid (tex<n> is bit n)
u8 registerCount; // R registers count u8 registerCount; // R registers count
u8 outputFromH0; // final color from R0 or H0 u8 outputFromH0; // final color from R0 or H0
u8 depthReplace; // fp generated z epth value u8 depthReplace; // fp generated z depth value
u8 pixelKill; // fp uses kill operations u8 pixelKill; // fp uses kill operations
}; };

View file

@ -274,7 +274,7 @@ namespace
} }
} }
inline void stream_data_to_memory_u8_non_continous(void *dst, const void *src, u32 vertex_count, u8 attribute_size, u8 dst_stride, u8 src_stride) inline void stream_data_to_memory_u8_non_continuous(void *dst, const void *src, u32 vertex_count, u8 attribute_size, u8 dst_stride, u8 src_stride)
{ {
char *src_ptr = (char *)src; char *src_ptr = (char *)src;
char *dst_ptr = (char *)dst; char *dst_ptr = (char *)dst;
@ -472,7 +472,7 @@ void write_vertex_array_data_to_buffer(gsl::span<gsl::byte> raw_dst_span, gsl::s
if (use_stream_no_stride) if (use_stream_no_stride)
memcpy(raw_dst_span.data(), src_ptr.data(), count * dst_stride); memcpy(raw_dst_span.data(), src_ptr.data(), count * dst_stride);
else if (use_stream_with_stride) else if (use_stream_with_stride)
stream_data_to_memory_u8_non_continous(raw_dst_span.data(), src_ptr.data(), count, vector_element_count, dst_stride, attribute_src_stride); stream_data_to_memory_u8_non_continuous(raw_dst_span.data(), src_ptr.data(), count, vector_element_count, dst_stride, attribute_src_stride);
else else
copy_whole_attribute_array<u8, u8>((void *)raw_dst_span.data(), (void *)src_ptr.data(), vector_element_count, dst_stride, attribute_src_stride, count, real_count); copy_whole_attribute_array<u8, u8>((void *)raw_dst_span.data(), (void *)src_ptr.data(), vector_element_count, dst_stride, attribute_src_stride, count, real_count);
@ -599,7 +599,7 @@ std::tuple<T, T, u32> expand_indexed_triangle_fan(gsl::span<to_be_t<const T>> sr
if (last_index == invalid_index) if (last_index == invalid_index)
{ {
//Need at least one anchor and one outer index to create a triange //Need at least one anchor and one outer index to create a triangle
last_index = index; last_index = index;
continue; continue;
} }

View file

@ -225,7 +225,7 @@ std::string FragmentProgramDecompiler::AddX2d()
} }
//Both of these were tested with a trace SoulCalibur IV title screen //Both of these were tested with a trace SoulCalibur IV title screen
//Failure to catch causes infinite values since theres alot of rcp(0) //Failure to catch causes infinite values since there is a lot of rcp(0)
std::string FragmentProgramDecompiler::NotZero(const std::string& code) std::string FragmentProgramDecompiler::NotZero(const std::string& code)
{ {
return "(max(abs(" + code + "), 0.0000000001) * sign(" + code + "))"; return "(max(abs(" + code + "), 0.0000000001) * sign(" + code + "))";
@ -238,8 +238,8 @@ std::string FragmentProgramDecompiler::NotZeroPositive(const std::string& code)
std::string FragmentProgramDecompiler::ClampValue(const std::string& code, u32 precision) std::string FragmentProgramDecompiler::ClampValue(const std::string& code, u32 precision)
{ {
//FP16 is expected to overflow alot easier at 0+-65504 //FP16 is expected to overflow a lot easier at 0+-65504
//FP32 can still work upto 0+-3.4E38 //FP32 can still work up to 0+-3.4E38
//See http://http.download.nvidia.com/developer/Papers/2005/FP_Specials/FP_Specials.pdf //See http://http.download.nvidia.com/developer/Papers/2005/FP_Specials/FP_Specials.pdf
switch (precision) switch (precision)
@ -374,7 +374,7 @@ void FragmentProgramDecompiler::AddCodeCond(const std::string& dst, const std::s
std::string cond = GetRawCond(); std::string cond = GetRawCond();
ShaderVariable dst_var(dst); ShaderVariable dst_var(dst);
dst_var.symplify(); dst_var.simplify();
//const char *c_mask = f; //const char *c_mask = f;
@ -501,7 +501,7 @@ std::string FragmentProgramDecompiler::BuildCode()
OS << "\n"; OS << "\n";
insertConstants(OS); insertConstants(OS);
OS << "\n"; OS << "\n";
insertIntputs(OS); insertInputs(OS);
OS << "\n"; OS << "\n";
insertOutputs(OS); insertOutputs(OS);
OS << "\n"; OS << "\n";
@ -557,7 +557,7 @@ bool FragmentProgramDecompiler::handle_sct(u32 opcode)
case RSX_FP_OPCODE_MIN: SetDst("min($0, $1)"); return true; case RSX_FP_OPCODE_MIN: SetDst("min($0, $1)"); return true;
case RSX_FP_OPCODE_MOV: SetDst("$0"); return true; case RSX_FP_OPCODE_MOV: SetDst("$0"); return true;
case RSX_FP_OPCODE_MUL: SetDst("($0 * $1)"); return true; case RSX_FP_OPCODE_MUL: SetDst("($0 * $1)"); return true;
// Note: It's higly likely that RCP is not IEEE compliant but a game that uses rcp(0) has to be found // Note: It's highly likely that RCP is not IEEE compliant but a game that uses rcp(0) has to be found
case RSX_FP_OPCODE_RCP: SetDst("(1. / " + NotZero("$0.x") + ").xxxx"); return true; case RSX_FP_OPCODE_RCP: SetDst("(1. / " + NotZero("$0.x") + ").xxxx"); return true;
// Note: RSQ is not IEEE compliant. rsq(0) is some big number (Silent Hill 3 HD) // Note: RSQ is not IEEE compliant. rsq(0) is some big number (Silent Hill 3 HD)
// It is not know what happens if 0 is negative. // It is not know what happens if 0 is negative.
@ -908,8 +908,8 @@ std::string FragmentProgramDecompiler::Decompile()
if (handle_tex_srb(opcode)) break; if (handle_tex_srb(opcode)) break;
//FENCT/FENCB do not actually reject instructions if they dont match the forced unit //FENCT/FENCB do not actually reject instructions if they dont match the forced unit
//Tested with Dark Souls II where the repecting FENCX instruction will result in empty luminance averaging shaders //Tested with Dark Souls II where the respecting FENCX instruction will result in empty luminance averaging shaders
//TODO: More reasearch is needed to determine what real HW does //TODO: More research is needed to determine what real HW does
if (handle_sct(opcode)) break; if (handle_sct(opcode)) break;
if (handle_scb(opcode)) break; if (handle_scb(opcode)) break;
forced_unit = FORCE_NONE; forced_unit = FORCE_NONE;

View file

@ -11,7 +11,7 @@
* - virtual std::string saturate(const std::string &code) = 0; * - virtual std::string saturate(const std::string &code) = 0;
* - virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) = 0; * - virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) = 0;
* - virtual void insertHeader(std::stringstream &OS) = 0; * - virtual void insertHeader(std::stringstream &OS) = 0;
* - virtual void insertIntputs(std::stringstream &OS) = 0; * - virtual void insertInputs(std::stringstream &OS) = 0;
* - virtual void insertOutputs(std::stringstream &OS) = 0; * - virtual void insertOutputs(std::stringstream &OS) = 0;
* - virtual void insertConstants(std::stringstream &OS) = 0; * - virtual void insertConstants(std::stringstream &OS) = 0;
* - virtual void insertMainStart(std::stringstream &OS) = 0; * - virtual void insertMainStart(std::stringstream &OS) = 0;
@ -223,7 +223,7 @@ protected:
virtual void insertHeader(std::stringstream &OS) = 0; virtual void insertHeader(std::stringstream &OS) = 0;
/** Insert global declaration of fragments inputs. /** Insert global declaration of fragments inputs.
*/ */
virtual void insertIntputs(std::stringstream &OS) = 0; virtual void insertInputs(std::stringstream &OS) = 0;
/** insert global declaration of fragments outputs. /** insert global declaration of fragments outputs.
*/ */
virtual void insertOutputs(std::stringstream &OS) = 0; virtual void insertOutputs(std::stringstream &OS) = 0;

View file

@ -198,7 +198,7 @@ public:
return swizzles[swizzles.size() - 1].length(); return swizzles[swizzles.size() - 1].length();
} }
ShaderVariable& symplify() ShaderVariable& simplify()
{ {
std::unordered_map<char, char> swizzle; std::unordered_map<char, char> swizzle;

View file

@ -494,7 +494,7 @@ u8 get_format_block_size_in_bytes(rsx::surface_color_format format)
} }
} }
size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 format, u16 mipmap, bool cubemap, size_t row_pitch_alignement, size_t mipmap_alignment) size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 format, u16 mipmap, bool cubemap, size_t row_pitch_alignment, size_t mipmap_alignment)
{ {
size_t w = width; size_t w = width;
size_t h = std::max<u16>(height, 1); size_t h = std::max<u16>(height, 1);
@ -510,7 +510,7 @@ size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 form
size_t result = 0; size_t result = 0;
for (u16 i = 0; i < mipmap; ++i) for (u16 i = 0; i < mipmap; ++i)
{ {
size_t rowPitch = align(block_size_in_byte * width_in_blocks, row_pitch_alignement); size_t rowPitch = align(block_size_in_byte * width_in_blocks, row_pitch_alignment);
result += align(rowPitch * height_in_blocks * d, mipmap_alignment); result += align(rowPitch * height_in_blocks * d, mipmap_alignment);
height_in_blocks = std::max<size_t>(height_in_blocks / 2, 1); height_in_blocks = std::max<size_t>(height_in_blocks / 2, 1);
width_in_blocks = std::max<size_t>(width_in_blocks / 2, 1); width_in_blocks = std::max<size_t>(width_in_blocks / 2, 1);
@ -519,16 +519,16 @@ size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 form
return result * (cubemap ? 6 : 1); return result * (cubemap ? 6 : 1);
} }
size_t get_placed_texture_storage_size(const rsx::fragment_texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment) size_t get_placed_texture_storage_size(const rsx::fragment_texture &texture, size_t row_pitch_alignment, size_t mipmap_alignment)
{ {
return get_placed_texture_storage_size(texture.width(), texture.height(), texture.depth(), texture.format(), texture.mipmap(), texture.cubemap(), return get_placed_texture_storage_size(texture.width(), texture.height(), texture.depth(), texture.format(), texture.mipmap(), texture.cubemap(),
row_pitch_alignement, mipmap_alignment); row_pitch_alignment, mipmap_alignment);
} }
size_t get_placed_texture_storage_size(const rsx::vertex_texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment) size_t get_placed_texture_storage_size(const rsx::vertex_texture &texture, size_t row_pitch_alignment, size_t mipmap_alignment)
{ {
return get_placed_texture_storage_size(texture.width(), texture.height(), texture.depth(), texture.format(), texture.mipmap(), texture.cubemap(), return get_placed_texture_storage_size(texture.width(), texture.height(), texture.depth(), texture.format(), texture.mipmap(), texture.cubemap(),
row_pitch_alignement, mipmap_alignment); row_pitch_alignment, mipmap_alignment);
} }

View file

@ -43,11 +43,11 @@ struct rsx_subresource_layout
/** /**
* Get size to store texture in a linear fashion. * Get size to store texture in a linear fashion.
* Storage is assumed to use a rowPitchAlignement boundary for every row of texture. * Storage is assumed to use a rowPitchAlignment boundary for every row of texture.
*/ */
size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 format, u16 mipmap, bool cubemap, size_t row_pitch_alignement, size_t mipmap_alignment); size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 format, u16 mipmap, bool cubemap, size_t row_pitch_alignment, size_t mipmap_alignment);
size_t get_placed_texture_storage_size(const rsx::fragment_texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment = 0x200); size_t get_placed_texture_storage_size(const rsx::fragment_texture &texture, size_t row_pitch_alignment, size_t mipmap_alignment = 0x200);
size_t get_placed_texture_storage_size(const rsx::vertex_texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment = 0x200); size_t get_placed_texture_storage_size(const rsx::vertex_texture &texture, size_t row_pitch_alignment, size_t mipmap_alignment = 0x200);
/** /**
* get all rsx_subresource_layout for texture. * get all rsx_subresource_layout for texture.

View file

@ -296,7 +296,7 @@ void VertexProgramDecompiler::AddCodeCond(const std::string& dst, const std::str
std::string cond = compareFunction(cond_string_table[d0.cond], AddCondReg() + swizzle, getFloatTypeName(4) + "(0., 0., 0., 0.)"); std::string cond = compareFunction(cond_string_table[d0.cond], AddCondReg() + swizzle, getFloatTypeName(4) + "(0., 0., 0., 0.)");
ShaderVariable dst_var(dst); ShaderVariable dst_var(dst);
dst_var.symplify(); dst_var.simplify();
//const char *c_mask = f; //const char *c_mask = f;

View file

@ -13,7 +13,7 @@
* - virtual std::string getFunction(enum class FUNCTION) = 0; * - virtual std::string getFunction(enum class FUNCTION) = 0;
* - virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) = 0; * - virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) = 0;
* - virtual void insertHeader(std::stringstream &OS) = 0; * - virtual void insertHeader(std::stringstream &OS) = 0;
* - virtual void insertIntputs(std::stringstream &OS) = 0; * - virtual void insertInputs(std::stringstream &OS) = 0;
* - virtual void insertOutputs(std::stringstream &OS) = 0; * - virtual void insertOutputs(std::stringstream &OS) = 0;
* - virtual void insertConstants(std::stringstream &OS) = 0; * - virtual void insertConstants(std::stringstream &OS) = 0;
* - virtual void insertMainStart(std::stringstream &OS) = 0; * - virtual void insertMainStart(std::stringstream &OS) = 0;

View file

@ -13,11 +13,11 @@ struct data_heap
/** /**
* Does alloc cross get position ? * Does alloc cross get position ?
*/ */
template<int Alignement> template<int Alignment>
bool can_alloc(size_t size) const bool can_alloc(size_t size) const
{ {
size_t alloc_size = align(size, Alignement); size_t alloc_size = align(size, Alignment);
size_t aligned_put_pos = align(m_put_pos, Alignement); size_t aligned_put_pos = align(m_put_pos, Alignment);
if (aligned_put_pos + alloc_size < m_size) if (aligned_put_pos + alloc_size < m_size)
{ {
// range before get // range before get
@ -70,17 +70,17 @@ public:
m_largest_allocated_pool = 0; m_largest_allocated_pool = 0;
} }
template<int Alignement> template<int Alignment>
size_t alloc(size_t size) size_t alloc(size_t size)
{ {
if (!can_alloc<Alignement>(size)) if (!can_alloc<Alignment>(size))
{ {
fmt::throw_exception("[%s] Working buffer not big enough, buffer_length=%d allocated=%d requested=%d guard=%d largest_pool=%d" HERE, fmt::throw_exception("[%s] Working buffer not big enough, buffer_length=%d allocated=%d requested=%d guard=%d largest_pool=%d" HERE,
m_name, m_size, m_current_allocated_size, size, m_min_guard_size, m_largest_allocated_pool); m_name, m_size, m_current_allocated_size, size, m_min_guard_size, m_largest_allocated_pool);
} }
size_t alloc_size = align(size, Alignement); size_t alloc_size = align(size, Alignment);
size_t aligned_put_pos = align(m_put_pos, Alignement); size_t aligned_put_pos = align(m_put_pos, Alignment);
const size_t block_length = (aligned_put_pos - m_put_pos) + alloc_size; const size_t block_length = (aligned_put_pos - m_put_pos) + alloc_size;
m_current_allocated_size += block_length; m_current_allocated_size += block_length;

View file

@ -624,10 +624,10 @@ namespace rsx
} }
/** /**
* Clipping and fitting lookup funcrions * Clipping and fitting lookup functions
* surface_overlaps - returns true if surface overlaps a given surface address and returns the relative x and y position of the surface address within the surface * surface_overlaps - returns true if surface overlaps a given surface address and returns the relative x and y position of the surface address within the surface
* address_is_bound - returns true if the surface at a given address is actively bound * address_is_bound - returns true if the surface at a given address is actively bound
* get_surface_subresource_if_available - returns a sectiion descriptor that allows to crop surfaces stored in memory * get_surface_subresource_if_available - returns a section descriptor that allows to crop surfaces stored in memory
*/ */
bool surface_overlaps_address(surface_type surface, u32 surface_address, u32 texaddr, u16 *x, u16 *y) bool surface_overlaps_address(surface_type surface, u32 surface_address, u32 texaddr, u16 *x, u16 *y)
{ {

View file

@ -272,7 +272,7 @@ namespace rsx
bool violation_handled = false; bool violation_handled = false;
std::vector<section_storage_type*> sections_to_flush; //Sections to be flushed std::vector<section_storage_type*> sections_to_flush; //Sections to be flushed
std::vector<section_storage_type*> sections_to_reprotect; //Sections to be protected after flushing std::vector<section_storage_type*> sections_to_reprotect; //Sections to be protected after flushing
std::vector<section_storage_type*> sections_to_unprotect; //These sections are to be unpotected and discarded by caller std::vector<section_storage_type*> sections_to_unprotect; //These sections are to be unprotected and discarded by caller
int num_flushable = 0; int num_flushable = 0;
u64 cache_tag = 0; u64 cache_tag = 0;
u32 address_base = 0; u32 address_base = 0;

View file

@ -94,12 +94,12 @@ DXGI_FORMAT get_depth_samplable_surface_format(rsx::surface_depth_format format)
UCHAR get_dxgi_texel_size(DXGI_FORMAT format); UCHAR get_dxgi_texel_size(DXGI_FORMAT format);
/** /**
* Convert front face value to bool value telling wheter front face is counterclockwise or not * Convert front face value to bool value telling whether front face is counterclockwise or not
*/ */
BOOL get_front_face_ccw(rsx::front_face set_front_face_value); BOOL get_front_face_ccw(rsx::front_face set_front_face_value);
/** /**
* Convert cull face value to a D3D12_CULL_MODE telling wheter cull face is front or back * Convert cull face value to a D3D12_CULL_MODE telling whether cull face is front or back
*/ */
D3D12_CULL_MODE get_cull_face(rsx::cull_face set_cull_face_value); D3D12_CULL_MODE get_cull_face(rsx::cull_face set_cull_face_value);

View file

@ -55,7 +55,7 @@ void D3D12FragmentDecompiler::insertHeader(std::stringstream & OS)
OS << "};\n"; OS << "};\n";
} }
void D3D12FragmentDecompiler::insertIntputs(std::stringstream & OS) void D3D12FragmentDecompiler::insertInputs(std::stringstream & OS)
{ {
OS << "struct PixelInput\n"; OS << "struct PixelInput\n";
OS << "{\n"; OS << "{\n";

View file

@ -14,7 +14,7 @@ protected:
virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) override; virtual std::string compareFunction(enum class COMPARE, const std::string &, const std::string &) override;
virtual void insertHeader(std::stringstream &OS) override; virtual void insertHeader(std::stringstream &OS) override;
virtual void insertIntputs(std::stringstream &OS) override; virtual void insertInputs(std::stringstream &OS) override;
virtual void insertOutputs(std::stringstream &OS) override; virtual void insertOutputs(std::stringstream &OS) override;
virtual void insertConstants(std::stringstream &OS) override; virtual void insertConstants(std::stringstream &OS) override;
virtual void insertGlobalFunctions(std::stringstream &OS) override; virtual void insertGlobalFunctions(std::stringstream &OS) override;

View file

@ -33,7 +33,7 @@ inline std::string get_hresult_message(HRESULT hr)
/** /**
* Send data to dst pointer without polluting cache. * Send data to dst pointer without polluting cache.
* Usefull to write to mapped memory from upload heap. * Useful to write to mapped memory from upload heap.
*/ */
inline inline
void streamToBuffer(void* dst, void* src, size_t sizeInBytes) void streamToBuffer(void* dst, void* src, size_t sizeInBytes)
@ -47,7 +47,7 @@ void streamToBuffer(void* dst, void* src, size_t sizeInBytes)
/** /**
* copy src to dst pointer without polluting cache. * copy src to dst pointer without polluting cache.
* Usefull to write to mapped memory from upload heap. * Useful to write to mapped memory from upload heap.
*/ */
inline inline
void streamBuffer(void* dst, void* src, size_t sizeInBytes) void streamBuffer(void* dst, void* src, size_t sizeInBytes)

View file

@ -33,7 +33,7 @@ void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
OS << "#version 430\n"; OS << "#version 430\n";
} }
void GLFragmentDecompilerThread::insertIntputs(std::stringstream & OS) void GLFragmentDecompilerThread::insertInputs(std::stringstream & OS)
{ {
bool two_sided_enabled = m_prog.front_back_color_enabled && (m_prog.back_color_diffuse_output || m_prog.back_color_specular_output); bool two_sided_enabled = m_prog.front_back_color_enabled && (m_prog.back_color_diffuse_output || m_prog.back_color_specular_output);
std::vector<std::string> inputs_to_declare; std::vector<std::string> inputs_to_declare;

View file

@ -25,7 +25,7 @@ protected:
virtual std::string compareFunction(COMPARE, const std::string&, const std::string&) override; virtual std::string compareFunction(COMPARE, const std::string&, const std::string&) override;
virtual void insertHeader(std::stringstream &OS) override; virtual void insertHeader(std::stringstream &OS) override;
virtual void insertIntputs(std::stringstream &OS) override; virtual void insertInputs(std::stringstream &OS) override;
virtual void insertOutputs(std::stringstream &OS) override; virtual void insertOutputs(std::stringstream &OS) override;
virtual void insertConstants(std::stringstream &OS) override; virtual void insertConstants(std::stringstream &OS) override;
virtual void insertGlobalFunctions(std::stringstream &OS) override; virtual void insertGlobalFunctions(std::stringstream &OS) override;

View file

@ -193,7 +193,7 @@ void GLGSRender::end()
if (manually_flush_ring_buffers) if (manually_flush_ring_buffers)
{ {
//Use approximations to reseve space. This path is mostly for debug purposes anyway //Use approximations to reserve space. This path is mostly for debug purposes anyway
u32 approx_vertex_count = rsx::method_registers.current_draw_clause.get_elements_count(); u32 approx_vertex_count = rsx::method_registers.current_draw_clause.get_elements_count();
u32 approx_working_buffer_size = approx_vertex_count * 256; u32 approx_working_buffer_size = approx_vertex_count * 256;
@ -212,7 +212,7 @@ void GLGSRender::end()
if (surface->get_internal_format() == surface->old_contents->get_internal_format()) if (surface->get_internal_format() == surface->old_contents->get_internal_format())
{ {
//Copy data from old contents onto this one //Copy data from old contents onto this one
//1. Clip a rectangular region defning the data //1. Clip a rectangular region defining the data
//2. Perform a GPU blit //2. Perform a GPU blit
u16 parent_w = surface->old_contents->width(); u16 parent_w = surface->old_contents->width();
u16 parent_h = surface->old_contents->height(); u16 parent_h = surface->old_contents->height();
@ -272,7 +272,7 @@ void GLGSRender::end()
if (buffers_to_clear.size() > 0 && !clear_all_color) if (buffers_to_clear.size() > 0 && !clear_all_color)
{ {
GLfloat colors[] = { 0.f, 0.f, 0.f, 0.f }; GLfloat colors[] = { 0.f, 0.f, 0.f, 0.f };
//It is impossible for the render target to be typa A or B here (clear all would have been flagged) //It is impossible for the render target to be type A or B here (clear all would have been flagged)
for (auto &i : buffers_to_clear) for (auto &i : buffers_to_clear)
glClearBufferfv(draw_fbo.id(), i, colors); glClearBufferfv(draw_fbo.id(), i, colors);
} }
@ -1308,7 +1308,7 @@ void GLGSRender::update_draw_state()
gl_state.enable(rsx::method_registers.poly_offset_fill_enabled(), GL_POLYGON_OFFSET_FILL); gl_state.enable(rsx::method_registers.poly_offset_fill_enabled(), GL_POLYGON_OFFSET_FILL);
//offset_bias is the constant factor, multiplied by the implementation factor R //offset_bias is the constant factor, multiplied by the implementation factor R
//offst_scale is the slope factor, multiplied by the triangle slope factor M //offset_scale is the slope factor, multiplied by the triangle slope factor M
gl_state.polygon_offset(rsx::method_registers.poly_offset_scale(), rsx::method_registers.poly_offset_bias()); gl_state.polygon_offset(rsx::method_registers.poly_offset_scale(), rsx::method_registers.poly_offset_bias());
if (gl_state.enable(rsx::method_registers.cull_face_enabled(), GL_CULL_FACE)) if (gl_state.enable(rsx::method_registers.cull_face_enabled(), GL_CULL_FACE))
@ -1414,7 +1414,7 @@ void GLGSRender::flip(int buffer)
if (!buffer_pitch) buffer_pitch = buffer_width * 4; if (!buffer_pitch) buffer_pitch = buffer_width * 4;
gl::pixel_unpack_settings unpack_settings; gl::pixel_unpack_settings unpack_settings;
unpack_settings.aligment(1).row_length(buffer_pitch / 4); unpack_settings.alignment(1).row_length(buffer_pitch / 4);
if (!m_flip_tex_color || m_flip_tex_color->size2D() != sizei{ (int)buffer_width, (int)buffer_height }) if (!m_flip_tex_color || m_flip_tex_color->size2D() != sizei{ (int)buffer_width, (int)buffer_height })
{ {

View file

@ -400,7 +400,7 @@ namespace gl
int m_skip_rows = 0; int m_skip_rows = 0;
int m_skip_pixels = 0; int m_skip_pixels = 0;
int m_skip_images = 0; int m_skip_images = 0;
int m_aligment = 4; int m_alignment = 4;
public: public:
void apply() const void apply() const
@ -412,7 +412,7 @@ namespace gl
glPixelStorei(GL_PACK_SKIP_ROWS, m_skip_rows); glPixelStorei(GL_PACK_SKIP_ROWS, m_skip_rows);
glPixelStorei(GL_PACK_SKIP_PIXELS, m_skip_pixels); glPixelStorei(GL_PACK_SKIP_PIXELS, m_skip_pixels);
glPixelStorei(GL_PACK_SKIP_IMAGES, m_skip_images); glPixelStorei(GL_PACK_SKIP_IMAGES, m_skip_images);
glPixelStorei(GL_PACK_ALIGNMENT, m_aligment); glPixelStorei(GL_PACK_ALIGNMENT, m_alignment);
} }
pixel_pack_settings& swap_bytes(bool value = true) pixel_pack_settings& swap_bytes(bool value = true)
@ -450,9 +450,9 @@ namespace gl
m_skip_images = value; m_skip_images = value;
return *this; return *this;
} }
pixel_pack_settings& aligment(int value) pixel_pack_settings& alignment(int value)
{ {
m_aligment = value; m_alignment = value;
return *this; return *this;
} }
}; };
@ -466,7 +466,7 @@ namespace gl
int m_skip_rows = 0; int m_skip_rows = 0;
int m_skip_pixels = 0; int m_skip_pixels = 0;
int m_skip_images = 0; int m_skip_images = 0;
int m_aligment = 4; int m_alignment = 4;
public: public:
void apply() const void apply() const
@ -478,7 +478,7 @@ namespace gl
glPixelStorei(GL_UNPACK_SKIP_ROWS, m_skip_rows); glPixelStorei(GL_UNPACK_SKIP_ROWS, m_skip_rows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, m_skip_pixels); glPixelStorei(GL_UNPACK_SKIP_PIXELS, m_skip_pixels);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, m_skip_images); glPixelStorei(GL_UNPACK_SKIP_IMAGES, m_skip_images);
glPixelStorei(GL_UNPACK_ALIGNMENT, m_aligment); glPixelStorei(GL_UNPACK_ALIGNMENT, m_alignment);
} }
pixel_unpack_settings& swap_bytes(bool value = true) pixel_unpack_settings& swap_bytes(bool value = true)
@ -516,9 +516,9 @@ namespace gl
m_skip_images = value; m_skip_images = value;
return *this; return *this;
} }
pixel_unpack_settings& aligment(int value) pixel_unpack_settings& alignment(int value)
{ {
m_aligment = value; m_alignment = value;
return *this; return *this;
} }
}; };

View file

@ -148,7 +148,7 @@ namespace gl
bool matches_dimensions(u16 _width, u16 _height) const bool matches_dimensions(u16 _width, u16 _height) const
{ {
//Use foward scaling to account for rounding and clamping errors //Use forward scaling to account for rounding and clamping errors
return (rsx::apply_resolution_scale(_width, true) == internal_width) && (rsx::apply_resolution_scale(_height, true) == internal_height); return (rsx::apply_resolution_scale(_width, true) == internal_width) && (rsx::apply_resolution_scale(_height, true) == internal_height);
} }
}; };

View file

@ -136,7 +136,7 @@ namespace gl
case GL_RGBA8: case GL_RGBA8:
return GL_SRGB8_ALPHA8; return GL_SRGB8_ALPHA8;
default: default:
//LOG_ERROR(RSX, "No gamma coversion for format 0x%X", in_format); //LOG_ERROR(RSX, "No gamma conversion for format 0x%X", in_format);
return in_format; return in_format;
} }
} }
@ -189,7 +189,7 @@ namespace gl
case rsx::texture_minify_filter::linear_linear: return GL_LINEAR_MIPMAP_LINEAR; case rsx::texture_minify_filter::linear_linear: return GL_LINEAR_MIPMAP_LINEAR;
case rsx::texture_minify_filter::convolution_min: return GL_LINEAR_MIPMAP_LINEAR; case rsx::texture_minify_filter::convolution_min: return GL_LINEAR_MIPMAP_LINEAR;
} }
fmt::throw_exception("Unknow min filter" HERE); fmt::throw_exception("Unknown min filter" HERE);
} }
int tex_mag_filter(rsx::texture_magnify_filter mag_filter) int tex_mag_filter(rsx::texture_magnify_filter mag_filter)
@ -200,7 +200,7 @@ namespace gl
case rsx::texture_magnify_filter::linear: return GL_LINEAR; case rsx::texture_magnify_filter::linear: return GL_LINEAR;
case rsx::texture_magnify_filter::convolution_mag: return GL_LINEAR; case rsx::texture_magnify_filter::convolution_mag: return GL_LINEAR;
} }
fmt::throw_exception("Unknow mag filter" HERE); fmt::throw_exception("Unknown mag filter" HERE);
} }
//Apply sampler state settings //Apply sampler state settings

View file

@ -407,9 +407,9 @@ namespace gl
glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id); glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id);
pixel_pack_settings pack_settings; pixel_pack_settings pack_settings;
pack_settings.aligment(1); pack_settings.alignment(1);
//NOTE: AMD properietary driver bug - disable swap bytes //NOTE: AMD proprietary driver bug - disable swap bytes
if (!::gl::get_driver_caps().vendor_AMD) if (!::gl::get_driver_caps().vendor_AMD)
pack_settings.swap_bytes(pack_unpack_swap_bytes); pack_settings.swap_bytes(pack_unpack_swap_bytes);

View file

@ -140,7 +140,7 @@ namespace
return{ 0, 0, 0, 0, std::make_tuple(get_index_type(type), offset_in_index_buffer) }; return{ 0, 0, 0, 0, std::make_tuple(get_index_type(type), offset_in_index_buffer) };
} }
//check for vertex arrays with frquency modifiers //check for vertex arrays with frequency modifiers
for (auto &block : m_vertex_layout.interleaved_blocks) for (auto &block : m_vertex_layout.interleaved_blocks)
{ {
if (block.min_divisor > 1) if (block.min_divisor > 1)

View file

@ -301,7 +301,7 @@ void GLVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
OS << " gl_Position = gl_Position * scale_offset_mat;\n"; OS << " gl_Position = gl_Position * scale_offset_mat;\n";
OS << " gl_Position = apply_zclip_xform(gl_Position, z_near, z_far);\n"; OS << " gl_Position = apply_zclip_xform(gl_Position, z_near, z_far);\n";
//Since our clip_space is symetrical [-1, 1] we map it to linear space using the eqn: //Since our clip_space is symmetrical [-1, 1] we map it to linear space using the eqn:
//ln = (clip * 2) - 1 to fully utilize the 0-1 range of the depth buffer //ln = (clip * 2) - 1 to fully utilize the 0-1 range of the depth buffer
//RSX matrices passed already map to the [0, 1] range but mapping to classic OGL requires that we undo this step //RSX matrices passed already map to the [0, 1] range but mapping to classic OGL requires that we undo this step
//This can be made unnecessary using the call glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE). //This can be made unnecessary using the call glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE).

View file

@ -747,7 +747,7 @@ namespace rsx
{ {
if (first_count[n].first != next) if (first_count[n].first != next)
{ {
LOG_ERROR(RSX, "Non-continous first-count range passed as one draw; will be split."); LOG_ERROR(RSX, "Non-continuous first-count range passed as one draw; will be split.");
first_count[deferred_call_size - 1].second = count; first_count[deferred_call_size - 1].second = count;
deferred_call_size++; deferred_call_size++;
@ -1057,7 +1057,7 @@ namespace rsx
} }
} }
// Generate wpos coeffecients // Generate wpos coefficients
// wpos equation is now as follows: // wpos equation is now as follows:
// wpos.y = (frag_coord / resolution_scale) * ((window_origin!=top)?-1.: 1.) + ((window_origin!=top)? window_height : 0) // wpos.y = (frag_coord / resolution_scale) * ((window_origin!=top)?-1.: 1.) + ((window_origin!=top)? window_height : 0)
// wpos.x = (frag_coord / resolution_scale) // wpos.x = (frag_coord / resolution_scale)

View file

@ -85,7 +85,7 @@ namespace rsx
{ {
running = 0, running = 0,
empty = 1, //PUT == GET empty = 1, //PUT == GET
spinning = 2, //Puller continously jumps to self addr (synchronization technique) spinning = 2, //Puller continuously jumps to self addr (synchronization technique)
nop = 3, //Puller is processing a NOP command nop = 3, //Puller is processing a NOP command
}; };

View file

@ -56,7 +56,7 @@ enum vec_opcode
RSX_VEC_OPCODE_SLE = 0x13, // Set-If-LessEqual RSX_VEC_OPCODE_SLE = 0x13, // Set-If-LessEqual
RSX_VEC_OPCODE_SNE = 0x14, // Set-If-NotEqual RSX_VEC_OPCODE_SNE = 0x14, // Set-If-NotEqual
RSX_VEC_OPCODE_STR = 0x15, // Set-If-True RSX_VEC_OPCODE_STR = 0x15, // Set-If-True
RSX_VEC_OPCODE_SSG = 0x16, // Convert postive values to 1 and negative values to -1 RSX_VEC_OPCODE_SSG = 0x16, // Convert positive values to 1 and negative values to -1
RSX_VEC_OPCODE_TXL = 0x19, // Texture fetch RSX_VEC_OPCODE_TXL = 0x19, // Texture fetch
}; };

View file

@ -33,7 +33,7 @@ void VKFragmentDecompilerThread::insertHeader(std::stringstream & OS)
OS << "#extension GL_ARB_separate_shader_objects: enable\n\n"; OS << "#extension GL_ARB_separate_shader_objects: enable\n\n";
} }
void VKFragmentDecompilerThread::insertIntputs(std::stringstream & OS) void VKFragmentDecompilerThread::insertInputs(std::stringstream & OS)
{ {
//It is possible for the two_sided_enabled flag to be set without actual 2-sided outputs //It is possible for the two_sided_enabled flag to be set without actual 2-sided outputs
bool two_sided_enabled = m_prog.front_back_color_enabled && (m_prog.back_color_diffuse_output || m_prog.back_color_specular_output); bool two_sided_enabled = m_prog.front_back_color_enabled && (m_prog.back_color_diffuse_output || m_prog.back_color_specular_output);

View file

@ -29,7 +29,7 @@ protected:
virtual std::string compareFunction(COMPARE, const std::string&, const std::string&) override; virtual std::string compareFunction(COMPARE, const std::string&, const std::string&) override;
virtual void insertHeader(std::stringstream &OS) override; virtual void insertHeader(std::stringstream &OS) override;
virtual void insertIntputs(std::stringstream &OS) override; virtual void insertInputs(std::stringstream &OS) override;
virtual void insertOutputs(std::stringstream &OS) override; virtual void insertOutputs(std::stringstream &OS) override;
virtual void insertConstants(std::stringstream &OS) override; virtual void insertConstants(std::stringstream &OS) override;
virtual void insertGlobalFunctions(std::stringstream &OS) override; virtual void insertGlobalFunctions(std::stringstream &OS) override;

View file

@ -338,34 +338,34 @@ namespace
std::vector<VkAttachmentDescription> attachments = {}; std::vector<VkAttachmentDescription> attachments = {};
std::vector<VkAttachmentReference> attachment_references; std::vector<VkAttachmentReference> attachment_references;
VkAttachmentDescription color_attachement_description = {}; VkAttachmentDescription color_attachment_description = {};
color_attachement_description.format = color_format; color_attachment_description.format = color_format;
color_attachement_description.samples = VK_SAMPLE_COUNT_1_BIT; color_attachment_description.samples = VK_SAMPLE_COUNT_1_BIT;
color_attachement_description.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; color_attachment_description.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
color_attachement_description.storeOp = VK_ATTACHMENT_STORE_OP_STORE; color_attachment_description.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
color_attachement_description.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; color_attachment_description.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
color_attachement_description.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; color_attachment_description.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
color_attachement_description.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; color_attachment_description.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
color_attachement_description.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; color_attachment_description.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
for (u32 i = 0; i < number_of_color_surface; ++i) for (u32 i = 0; i < number_of_color_surface; ++i)
{ {
attachments.push_back(color_attachement_description); attachments.push_back(color_attachment_description);
attachment_references.push_back({ i, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }); attachment_references.push_back({ i, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL });
} }
if (depth_format != VK_FORMAT_UNDEFINED) if (depth_format != VK_FORMAT_UNDEFINED)
{ {
VkAttachmentDescription depth_attachement_description = {}; VkAttachmentDescription depth_attachment_description = {};
depth_attachement_description.format = depth_format; depth_attachment_description.format = depth_format;
depth_attachement_description.samples = VK_SAMPLE_COUNT_1_BIT; depth_attachment_description.samples = VK_SAMPLE_COUNT_1_BIT;
depth_attachement_description.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; depth_attachment_description.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
depth_attachement_description.storeOp = VK_ATTACHMENT_STORE_OP_STORE; depth_attachment_description.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
depth_attachement_description.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD; depth_attachment_description.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
depth_attachement_description.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; depth_attachment_description.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE;
depth_attachement_description.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; depth_attachment_description.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
depth_attachement_description.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; depth_attachment_description.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
attachments.push_back(depth_attachement_description); attachments.push_back(depth_attachment_description);
attachment_references.push_back({ number_of_color_surface, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL }); attachment_references.push_back({ number_of_color_surface, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL });
} }
@ -1764,7 +1764,7 @@ void VKGSRender::clear_surface(u32 mask)
fmt::throw_exception("Unreachable" HERE); fmt::throw_exception("Unreachable" HERE);
} }
//Fush unconditinally - parameters might not persist //Fush unconditionally - parameters might not persist
//TODO: Better parameter management for overlay passes //TODO: Better parameter management for overlay passes
flush_command_queue(); flush_command_queue();
} }
@ -1857,7 +1857,7 @@ void VKGSRender::flush_command_queue(bool hard_sync)
//swap handler checks the pending flag, so call it here //swap handler checks the pending flag, so call it here
process_swap_request(m_current_frame); process_swap_request(m_current_frame);
//wait for the latest intruction to execute //wait for the latest instruction to execute
m_current_command_buffer->pending = true; m_current_command_buffer->pending = true;
m_current_command_buffer->reset(); m_current_command_buffer->reset();
@ -2472,7 +2472,7 @@ void VKGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk
if (&ctx == m_current_frame && ctx.swap_command_buffer->pending) if (&ctx == m_current_frame && ctx.swap_command_buffer->pending)
{ {
//Instead of stoppiing to wait, use the aux storage to ease pressure //Instead of stopping to wait, use the aux storage to ease pressure
m_aux_frame_context.grab_resources(*m_current_frame); m_aux_frame_context.grab_resources(*m_current_frame);
m_current_frame = &m_aux_frame_context; m_current_frame = &m_aux_frame_context;
} }

View file

@ -37,7 +37,7 @@ namespace vk
} }
//Heap allocation sizes in MB //Heap allocation sizes in MB
//NOTE: Texture uploads can be huge, upto 16MB for a single texture (4096x4096px) //NOTE: Texture uploads can be huge, up to 16MB for a single texture (4096x4096px)
#define VK_ATTRIB_RING_BUFFER_SIZE_M 384 #define VK_ATTRIB_RING_BUFFER_SIZE_M 384
#define VK_TEXTURE_UPLOAD_RING_BUFFER_SIZE_M 256 #define VK_TEXTURE_UPLOAD_RING_BUFFER_SIZE_M 256
#define VK_UBO_RING_BUFFER_SIZE_M 64 #define VK_UBO_RING_BUFFER_SIZE_M 64

View file

@ -211,7 +211,7 @@ namespace vk
//Radeon fails to properly handle degenerate primitives if primitive restart is enabled //Radeon fails to properly handle degenerate primitives if primitive restart is enabled
//One has to choose between using degenerate primitives or primitive restart to break up lists but not both //One has to choose between using degenerate primitives or primitive restart to break up lists but not both
//Polaris and newer will crash with ERROR_DEVICE_LOST //Polaris and newer will crash with ERROR_DEVICE_LOST
//Older GCN will work okay most of the time but also occasionally draws garbage without reason (properietary driver only) //Older GCN will work okay most of the time but also occasionally draws garbage without reason (proprietary driver only)
if (gpu_name.find("Radeon") != std::string::npos || //Proprietary driver if (gpu_name.find("Radeon") != std::string::npos || //Proprietary driver
gpu_name.find("POLARIS") != std::string::npos || //RADV POLARIS gpu_name.find("POLARIS") != std::string::npos || //RADV POLARIS
gpu_name.find("VEGA") != std::string::npos) //RADV VEGA gpu_name.find("VEGA") != std::string::npos) //RADV VEGA

View file

@ -853,7 +853,7 @@ namespace vk
enum access_type_hint enum access_type_hint
{ {
flush_only, //Only to be submitted/opened/closed via command flush flush_only, //Only to be submitted/opened/closed via command flush
all //Auxilliary, can be sumitted/opened/closed at any time all //Auxiliary, can be submitted/opened/closed at any time
} }
access_hint = flush_only; access_hint = flush_only;
@ -1644,7 +1644,7 @@ public:
{ {
m_instance = nullptr; m_instance = nullptr;
//Check that some critical entry-points have been loaded into memory indicating prescence of a loader //Check that some critical entry-points have been loaded into memory indicating presence of a loader
loader_exists = (vkCreateInstance != nullptr); loader_exists = (vkCreateInstance != nullptr);
} }

View file

@ -91,7 +91,7 @@ namespace vk
bool matches_dimensions(u16 _width, u16 _height) const bool matches_dimensions(u16 _width, u16 _height) const
{ {
//Use foward scaling to account for rounding and clamping errors //Use forward scaling to account for rounding and clamping errors
return (rsx::apply_resolution_scale(_width, true) == width()) && (rsx::apply_resolution_scale(_height, true) == height()); return (rsx::apply_resolution_scale(_width, true) == width()) && (rsx::apply_resolution_scale(_height, true) == height());
} }
}; };

View file

@ -559,7 +559,7 @@ namespace vk
{ {
//This is a data cast operation //This is a data cast operation
//Use native mapping for the new type //Use native mapping for the new type
//TODO: Also simlulate the readback+reupload step (very tricky) //TODO: Also simulate the readback+reupload step (very tricky)
const auto remap = get_component_mapping(gcm_format); const auto remap = get_component_mapping(gcm_format);
view_swizzle = { remap[1], remap[2], remap[3], remap[0] }; view_swizzle = { remap[1], remap[2], remap[3], remap[0] };
} }

View file

@ -192,7 +192,7 @@ namespace
std::optional<std::tuple<VkDeviceSize, VkIndexType>> index_info = std::optional<std::tuple<VkDeviceSize, VkIndexType>> index_info =
std::make_tuple(offset_in_index_buffer, vk::get_index_type(index_type)); std::make_tuple(offset_in_index_buffer, vk::get_index_type(index_type));
//check for vertex arrays with frquency modifiers //check for vertex arrays with frequency modifiers
for (auto &block : m_vertex_layout.interleaved_blocks) for (auto &block : m_vertex_layout.interleaved_blocks)
{ {
if (block.min_divisor > 1) if (block.min_divisor > 1)

View file

@ -11,7 +11,7 @@ namespace rsx
{ {
enum protection_policy enum protection_policy
{ {
protect_policy_one_page, //Only guard one page, preferrably one where this section 'wholly' fits protect_policy_one_page, //Only guard one page, preferably one where this section 'wholly' fits
protect_policy_conservative, //Guards as much memory as possible that is guaranteed to only be covered by the defined range without sharing protect_policy_conservative, //Guards as much memory as possible that is guaranteed to only be covered by the defined range without sharing
protect_policy_full_range //Guard the full memory range. Shared pages may be invalidated by access outside the object we're guarding protect_policy_full_range //Guard the full memory range. Shared pages may be invalidated by access outside the object we're guarding
}; };

View file

@ -2326,7 +2326,7 @@ struct registers_decoder<NV0039_LINE_LENGTH_IN>
static std::string dump(decoded_type &&decoded_values) static std::string dump(decoded_type &&decoded_values)
{ {
return "NV0039: line lenght input = " + std::to_string(decoded_values.input_line_length()); return "NV0039: line length input = " + std::to_string(decoded_values.input_line_length());
} }
}; };

View file

@ -664,7 +664,7 @@ namespace rsx
u32 dst_dma = 0; u32 dst_dma = 0;
rsx::blit_engine::transfer_destination_format dst_color_format; rsx::blit_engine::transfer_destination_format dst_color_format;
u32 out_pitch = 0; u32 out_pitch = 0;
u32 out_aligment = 64; u32 out_alignment = 64;
switch (method_registers.blit_engine_context_surface()) switch (method_registers.blit_engine_context_surface())
{ {
@ -673,7 +673,7 @@ namespace rsx
dst_offset = method_registers.blit_engine_output_offset_nv3062(); dst_offset = method_registers.blit_engine_output_offset_nv3062();
dst_color_format = method_registers.blit_engine_nv3062_color_format(); dst_color_format = method_registers.blit_engine_nv3062_color_format();
out_pitch = method_registers.blit_engine_output_pitch_nv3062(); out_pitch = method_registers.blit_engine_output_pitch_nv3062();
out_aligment = method_registers.blit_engine_output_alignment_nv3062(); out_alignment = method_registers.blit_engine_output_alignment_nv3062();
break; break;
case blit_engine::context_surface::swizzle2d: case blit_engine::context_surface::swizzle2d:
@ -1136,7 +1136,7 @@ namespace rsx
namespace gcm namespace gcm
{ {
// not entirely sure which one should actually do the flip, or if these should be handled seperately, // not entirely sure which one should actually do the flip, or if these should be handled separately,
// so for now lets flip in queue and just let the driver deal with it // so for now lets flip in queue and just let the driver deal with it
template<u32 index> template<u32 index>
struct driver_flip struct driver_flip