diff options
| author | 2018-09-15 15:21:06 +0200 | |
|---|---|---|
| committer | 2018-09-15 15:21:06 +0200 | |
| commit | 63c2e32e207d31ecadd9022e1d7cd705c9febac8 (patch) | |
| tree | 8a90e8ef2804f147dff7225a543a8740ecf7160c /src/video_core/engines | |
| parent | Merge pull request #1310 from lioncash/kernel-ns (diff) | |
| download | yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.gz yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.xz yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.zip | |
Port #4182 from Citra: "Prefix all size_t with std::"
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 28 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 2 | ||||
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 18 |
6 files changed, 33 insertions, 32 deletions
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index dcf9ef8b9..021b83eaa 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -26,7 +26,7 @@ public: | |||
| 26 | void WriteReg(u32 method, u32 value); | 26 | void WriteReg(u32 method, u32 value); |
| 27 | 27 | ||
| 28 | struct Regs { | 28 | struct Regs { |
| 29 | static constexpr size_t NUM_REGS = 0x258; | 29 | static constexpr std::size_t NUM_REGS = 0x258; |
| 30 | 30 | ||
| 31 | struct Surface { | 31 | struct Surface { |
| 32 | RenderTargetFormat format; | 32 | RenderTargetFormat format; |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 329079ddd..8afd26fe9 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -248,8 +248,8 @@ void Maxwell3D::DrawArrays() { | |||
| 248 | 248 | ||
| 249 | void Maxwell3D::ProcessCBBind(Regs::ShaderStage stage) { | 249 | void Maxwell3D::ProcessCBBind(Regs::ShaderStage stage) { |
| 250 | // Bind the buffer currently in CB_ADDRESS to the specified index in the desired shader stage. | 250 | // Bind the buffer currently in CB_ADDRESS to the specified index in the desired shader stage. |
| 251 | auto& shader = state.shader_stages[static_cast<size_t>(stage)]; | 251 | auto& shader = state.shader_stages[static_cast<std::size_t>(stage)]; |
| 252 | auto& bind_data = regs.cb_bind[static_cast<size_t>(stage)]; | 252 | auto& bind_data = regs.cb_bind[static_cast<std::size_t>(stage)]; |
| 253 | 253 | ||
| 254 | auto& buffer = shader.const_buffers[bind_data.index]; | 254 | auto& buffer = shader.const_buffers[bind_data.index]; |
| 255 | 255 | ||
| @@ -316,14 +316,14 @@ Texture::TSCEntry Maxwell3D::GetTSCEntry(u32 tsc_index) const { | |||
| 316 | std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderStage stage) const { | 316 | std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderStage stage) const { |
| 317 | std::vector<Texture::FullTextureInfo> textures; | 317 | std::vector<Texture::FullTextureInfo> textures; |
| 318 | 318 | ||
| 319 | auto& fragment_shader = state.shader_stages[static_cast<size_t>(stage)]; | 319 | auto& fragment_shader = state.shader_stages[static_cast<std::size_t>(stage)]; |
| 320 | auto& tex_info_buffer = fragment_shader.const_buffers[regs.tex_cb_index]; | 320 | auto& tex_info_buffer = fragment_shader.const_buffers[regs.tex_cb_index]; |
| 321 | ASSERT(tex_info_buffer.enabled && tex_info_buffer.address != 0); | 321 | ASSERT(tex_info_buffer.enabled && tex_info_buffer.address != 0); |
| 322 | 322 | ||
| 323 | GPUVAddr tex_info_buffer_end = tex_info_buffer.address + tex_info_buffer.size; | 323 | GPUVAddr tex_info_buffer_end = tex_info_buffer.address + tex_info_buffer.size; |
| 324 | 324 | ||
| 325 | // Offset into the texture constbuffer where the texture info begins. | 325 | // Offset into the texture constbuffer where the texture info begins. |
| 326 | static constexpr size_t TextureInfoOffset = 0x20; | 326 | static constexpr std::size_t TextureInfoOffset = 0x20; |
| 327 | 327 | ||
| 328 | for (GPUVAddr current_texture = tex_info_buffer.address + TextureInfoOffset; | 328 | for (GPUVAddr current_texture = tex_info_buffer.address + TextureInfoOffset; |
| 329 | current_texture < tex_info_buffer_end; current_texture += sizeof(Texture::TextureHandle)) { | 329 | current_texture < tex_info_buffer_end; current_texture += sizeof(Texture::TextureHandle)) { |
| @@ -360,8 +360,9 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt | |||
| 360 | return textures; | 360 | return textures; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, size_t offset) const { | 363 | Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, |
| 364 | auto& shader = state.shader_stages[static_cast<size_t>(stage)]; | 364 | std::size_t offset) const { |
| 365 | auto& shader = state.shader_stages[static_cast<std::size_t>(stage)]; | ||
| 365 | auto& tex_info_buffer = shader.const_buffers[regs.tex_cb_index]; | 366 | auto& tex_info_buffer = shader.const_buffers[regs.tex_cb_index]; |
| 366 | ASSERT(tex_info_buffer.enabled && tex_info_buffer.address != 0); | 367 | ASSERT(tex_info_buffer.enabled && tex_info_buffer.address != 0); |
| 367 | 368 | ||
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index d3be900a4..b81b0723d 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -34,17 +34,17 @@ public: | |||
| 34 | /// Register structure of the Maxwell3D engine. | 34 | /// Register structure of the Maxwell3D engine. |
| 35 | /// TODO(Subv): This structure will need to be made bigger as more registers are discovered. | 35 | /// TODO(Subv): This structure will need to be made bigger as more registers are discovered. |
| 36 | struct Regs { | 36 | struct Regs { |
| 37 | static constexpr size_t NUM_REGS = 0xE00; | 37 | static constexpr std::size_t NUM_REGS = 0xE00; |
| 38 | 38 | ||
| 39 | static constexpr size_t NumRenderTargets = 8; | 39 | static constexpr std::size_t NumRenderTargets = 8; |
| 40 | static constexpr size_t NumViewports = 16; | 40 | static constexpr std::size_t NumViewports = 16; |
| 41 | static constexpr size_t NumCBData = 16; | 41 | static constexpr std::size_t NumCBData = 16; |
| 42 | static constexpr size_t NumVertexArrays = 32; | 42 | static constexpr std::size_t NumVertexArrays = 32; |
| 43 | static constexpr size_t NumVertexAttributes = 32; | 43 | static constexpr std::size_t NumVertexAttributes = 32; |
| 44 | static constexpr size_t MaxShaderProgram = 6; | 44 | static constexpr std::size_t MaxShaderProgram = 6; |
| 45 | static constexpr size_t MaxShaderStage = 5; | 45 | static constexpr std::size_t MaxShaderStage = 5; |
| 46 | // Maximum number of const buffers per shader stage. | 46 | // Maximum number of const buffers per shader stage. |
| 47 | static constexpr size_t MaxConstBuffers = 18; | 47 | static constexpr std::size_t MaxConstBuffers = 18; |
| 48 | 48 | ||
| 49 | enum class QueryMode : u32 { | 49 | enum class QueryMode : u32 { |
| 50 | Write = 0, | 50 | Write = 0, |
| @@ -443,9 +443,9 @@ public: | |||
| 443 | } | 443 | } |
| 444 | }; | 444 | }; |
| 445 | 445 | ||
| 446 | bool IsShaderConfigEnabled(size_t index) const { | 446 | bool IsShaderConfigEnabled(std::size_t index) const { |
| 447 | // The VertexB is always enabled. | 447 | // The VertexB is always enabled. |
| 448 | if (index == static_cast<size_t>(Regs::ShaderProgram::VertexB)) { | 448 | if (index == static_cast<std::size_t>(Regs::ShaderProgram::VertexB)) { |
| 449 | return true; | 449 | return true; |
| 450 | } | 450 | } |
| 451 | return shader_config[index].enable != 0; | 451 | return shader_config[index].enable != 0; |
| @@ -571,7 +571,7 @@ public: | |||
| 571 | BitField<25, 3, u32> map_7; | 571 | BitField<25, 3, u32> map_7; |
| 572 | }; | 572 | }; |
| 573 | 573 | ||
| 574 | u32 GetMap(size_t index) const { | 574 | u32 GetMap(std::size_t index) const { |
| 575 | const std::array<u32, NumRenderTargets> maps{map_0, map_1, map_2, map_3, | 575 | const std::array<u32, NumRenderTargets> maps{map_0, map_1, map_2, map_3, |
| 576 | map_4, map_5, map_6, map_7}; | 576 | map_4, map_5, map_6, map_7}; |
| 577 | ASSERT(index < maps.size()); | 577 | ASSERT(index < maps.size()); |
| @@ -925,7 +925,7 @@ public: | |||
| 925 | std::vector<Texture::FullTextureInfo> GetStageTextures(Regs::ShaderStage stage) const; | 925 | std::vector<Texture::FullTextureInfo> GetStageTextures(Regs::ShaderStage stage) const; |
| 926 | 926 | ||
| 927 | /// Returns the texture information for a specific texture in a specific shader stage. | 927 | /// Returns the texture information for a specific texture in a specific shader stage. |
| 928 | Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, size_t offset) const; | 928 | Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const; |
| 929 | 929 | ||
| 930 | private: | 930 | private: |
| 931 | VideoCore::RasterizerInterface& rasterizer; | 931 | VideoCore::RasterizerInterface& rasterizer; |
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index c24d33d5c..aa7481b8c 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -50,7 +50,7 @@ void MaxwellDMA::HandleCopy() { | |||
| 50 | ASSERT(regs.dst_params.pos_y == 0); | 50 | ASSERT(regs.dst_params.pos_y == 0); |
| 51 | 51 | ||
| 52 | if (regs.exec.is_dst_linear == regs.exec.is_src_linear) { | 52 | if (regs.exec.is_dst_linear == regs.exec.is_src_linear) { |
| 53 | size_t copy_size = regs.x_count; | 53 | std::size_t copy_size = regs.x_count; |
| 54 | 54 | ||
| 55 | // When the enable_2d bit is disabled, the copy is performed as if we were copying a 1D | 55 | // When the enable_2d bit is disabled, the copy is performed as if we were copying a 1D |
| 56 | // buffer of length `x_count`, otherwise we copy a 2D buffer of size (x_count, y_count). | 56 | // buffer of length `x_count`, otherwise we copy a 2D buffer of size (x_count, y_count). |
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 7882f16e0..311ccb616 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -23,7 +23,7 @@ public: | |||
| 23 | void WriteReg(u32 method, u32 value); | 23 | void WriteReg(u32 method, u32 value); |
| 24 | 24 | ||
| 25 | struct Regs { | 25 | struct Regs { |
| 26 | static constexpr size_t NUM_REGS = 0x1D6; | 26 | static constexpr std::size_t NUM_REGS = 0x1D6; |
| 27 | 27 | ||
| 28 | struct Parameters { | 28 | struct Parameters { |
| 29 | union { | 29 | union { |
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 58f2904ce..d85c5883d 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -20,10 +20,10 @@ namespace Tegra::Shader { | |||
| 20 | 20 | ||
| 21 | struct Register { | 21 | struct Register { |
| 22 | /// Number of registers | 22 | /// Number of registers |
| 23 | static constexpr size_t NumRegisters = 256; | 23 | static constexpr std::size_t NumRegisters = 256; |
| 24 | 24 | ||
| 25 | /// Register 255 is special cased to always be 0 | 25 | /// Register 255 is special cased to always be 0 |
| 26 | static constexpr size_t ZeroIndex = 255; | 26 | static constexpr std::size_t ZeroIndex = 255; |
| 27 | 27 | ||
| 28 | enum class Size : u64 { | 28 | enum class Size : u64 { |
| 29 | Byte = 0, | 29 | Byte = 0, |
| @@ -584,7 +584,7 @@ union Instruction { | |||
| 584 | BitField<31, 4, u64> component_mask; | 584 | BitField<31, 4, u64> component_mask; |
| 585 | BitField<55, 3, TextureProcessMode> process_mode; | 585 | BitField<55, 3, TextureProcessMode> process_mode; |
| 586 | 586 | ||
| 587 | bool IsComponentEnabled(size_t component) const { | 587 | bool IsComponentEnabled(std::size_t component) const { |
| 588 | return ((1ull << component) & component_mask) != 0; | 588 | return ((1ull << component) & component_mask) != 0; |
| 589 | } | 589 | } |
| 590 | } tex; | 590 | } tex; |
| @@ -599,7 +599,7 @@ union Instruction { | |||
| 599 | BitField<29, 2, TextureType> texture_type; | 599 | BitField<29, 2, TextureType> texture_type; |
| 600 | BitField<31, 4, u64> component_mask; | 600 | BitField<31, 4, u64> component_mask; |
| 601 | 601 | ||
| 602 | bool IsComponentEnabled(size_t component) const { | 602 | bool IsComponentEnabled(std::size_t component) const { |
| 603 | return ((1ull << component) & component_mask) != 0; | 603 | return ((1ull << component) & component_mask) != 0; |
| 604 | } | 604 | } |
| 605 | } tmml; | 605 | } tmml; |
| @@ -646,7 +646,7 @@ union Instruction { | |||
| 646 | return gpr28.Value() != Register::ZeroIndex; | 646 | return gpr28.Value() != Register::ZeroIndex; |
| 647 | } | 647 | } |
| 648 | 648 | ||
| 649 | bool IsComponentEnabled(size_t component) const { | 649 | bool IsComponentEnabled(std::size_t component) const { |
| 650 | static constexpr std::array<std::array<u32, 8>, 4> mask_lut{{ | 650 | static constexpr std::array<std::array<u32, 8>, 4> mask_lut{{ |
| 651 | {}, | 651 | {}, |
| 652 | {0x1, 0x2, 0x4, 0x8, 0x3, 0x9, 0xa, 0xc}, | 652 | {0x1, 0x2, 0x4, 0x8, 0x3, 0x9, 0xa, 0xc}, |
| @@ -654,7 +654,7 @@ union Instruction { | |||
| 654 | {0x7, 0xb, 0xd, 0xe, 0xf}, | 654 | {0x7, 0xb, 0xd, 0xe, 0xf}, |
| 655 | }}; | 655 | }}; |
| 656 | 656 | ||
| 657 | size_t index{gpr0.Value() != Register::ZeroIndex ? 1U : 0U}; | 657 | std::size_t index{gpr0.Value() != Register::ZeroIndex ? 1U : 0U}; |
| 658 | index |= gpr28.Value() != Register::ZeroIndex ? 2 : 0; | 658 | index |= gpr28.Value() != Register::ZeroIndex ? 2 : 0; |
| 659 | 659 | ||
| 660 | u32 mask = mask_lut[index][component_mask_selector]; | 660 | u32 mask = mask_lut[index][component_mask_selector]; |
| @@ -939,7 +939,7 @@ public: | |||
| 939 | private: | 939 | private: |
| 940 | struct Detail { | 940 | struct Detail { |
| 941 | private: | 941 | private: |
| 942 | static constexpr size_t opcode_bitsize = 16; | 942 | static constexpr std::size_t opcode_bitsize = 16; |
| 943 | 943 | ||
| 944 | /** | 944 | /** |
| 945 | * Generates the mask and the expected value after masking from a given bitstring. | 945 | * Generates the mask and the expected value after masking from a given bitstring. |
| @@ -948,8 +948,8 @@ private: | |||
| 948 | */ | 948 | */ |
| 949 | static auto GetMaskAndExpect(const char* const bitstring) { | 949 | static auto GetMaskAndExpect(const char* const bitstring) { |
| 950 | u16 mask = 0, expect = 0; | 950 | u16 mask = 0, expect = 0; |
| 951 | for (size_t i = 0; i < opcode_bitsize; i++) { | 951 | for (std::size_t i = 0; i < opcode_bitsize; i++) { |
| 952 | const size_t bit_position = opcode_bitsize - i - 1; | 952 | const std::size_t bit_position = opcode_bitsize - i - 1; |
| 953 | switch (bitstring[i]) { | 953 | switch (bitstring[i]) { |
| 954 | case '0': | 954 | case '0': |
| 955 | mask |= 1 << bit_position; | 955 | mask |= 1 << bit_position; |