mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-16 02:49:48 +12:00
Add const equvalent for OpenGL::Vector operator[]
This commit is contained in:
parent
df414acc23
commit
48e25870a5
2 changed files with 14 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstddef>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -546,7 +547,8 @@ namespace OpenGL {
|
||||||
T& y() { return g(); }
|
T& y() { return g(); }
|
||||||
T& z() { return b(); }
|
T& z() { return b(); }
|
||||||
T& w() { return a(); }
|
T& w() { return a(); }
|
||||||
T& operator[](int index) { return m_storage[index]; }
|
T& operator[](size_t index) { return m_storage[index]; }
|
||||||
|
const T& operator[](size_t index) const { return m_storage[index]; }
|
||||||
|
|
||||||
T& u() { return r(); }
|
T& u() { return r(); }
|
||||||
T& v() { return g(); }
|
T& v() { return g(); }
|
||||||
|
|
|
@ -103,6 +103,7 @@ void ShaderEmitter::compileInstruction(const PICAShader& shaderUnit) {
|
||||||
case ShaderOpcodes::IFC: recIFC(shaderUnit, instruction); break;
|
case ShaderOpcodes::IFC: recIFC(shaderUnit, instruction); break;
|
||||||
case ShaderOpcodes::IFU: recIFU(shaderUnit, instruction); break;
|
case ShaderOpcodes::IFU: recIFU(shaderUnit, instruction); break;
|
||||||
case ShaderOpcodes::MOV: recMOV(shaderUnit, instruction); break;
|
case ShaderOpcodes::MOV: recMOV(shaderUnit, instruction); break;
|
||||||
|
case ShaderOpcodes::MOVA: recMOVA(shaderUnit, instruction); break;
|
||||||
case ShaderOpcodes::MAX: recMAX(shaderUnit, instruction); break;
|
case ShaderOpcodes::MAX: recMAX(shaderUnit, instruction); break;
|
||||||
case ShaderOpcodes::MUL: recMUL(shaderUnit, instruction); break;
|
case ShaderOpcodes::MUL: recMUL(shaderUnit, instruction); break;
|
||||||
case ShaderOpcodes::NOP: break;
|
case ShaderOpcodes::NOP: break;
|
||||||
|
@ -280,6 +281,16 @@ void ShaderEmitter::recMOV(const PICAShader& shader, u32 instruction) {
|
||||||
const u32 operandDescriptor = shader.operandDescriptors[instruction & 0x7f];
|
const u32 operandDescriptor = shader.operandDescriptors[instruction & 0x7f];
|
||||||
const u32 src = getBits<12, 7>(instruction);
|
const u32 src = getBits<12, 7>(instruction);
|
||||||
const u32 idx = getBits<19, 2>(instruction);
|
const u32 idx = getBits<19, 2>(instruction);
|
||||||
|
|
||||||
|
loadRegister<1>(src1_xmm, shader, src, idx, operandDescriptor); // Load source 1 into scratch1
|
||||||
|
u32 componentMask = operandDescriptor & 0xf;
|
||||||
|
Helpers::panic("Implement MOVA");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShaderEmitter::recMOVA(const PICAShader& shader, u32 instruction) {
|
||||||
|
const u32 operandDescriptor = shader.operandDescriptors[instruction & 0x7f];
|
||||||
|
const u32 src = getBits<12, 7>(instruction);
|
||||||
|
const u32 idx = getBits<19, 2>(instruction);
|
||||||
const u32 dest = getBits<21, 5>(instruction);
|
const u32 dest = getBits<21, 5>(instruction);
|
||||||
|
|
||||||
loadRegister<1>(src1_xmm, shader, src, idx, operandDescriptor); // Load source 1 into scratch1
|
loadRegister<1>(src1_xmm, shader, src, idx, operandDescriptor); // Load source 1 into scratch1
|
||||||
|
|
Loading…
Add table
Reference in a new issue