mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 11:03:45 +01:00
Merge pull request #10214 from hrydgard/1.5-crash-fixes-3
More various post-1.5 fixes
This commit is contained in:
6 files changed
+11
-15
No files matched your search
+4
-7
@@ -438,14 +438,11 @@ void Write_Opcode_JIT(const u32 _Address, const Opcode& _Value)
|
||||
Memory::WriteUnchecked_U32(_Value.encoding, _Address);
|
||||
}
|
||||
|
||||
void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
|
||||
{
|
||||
u8 *ptr = GetPointer(_Address);
|
||||
if (ptr != NULL) {
|
||||
void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength) {
|
||||
if (IsValidRange(_Address, _iLength)) {
|
||||
uint8_t *ptr = GetPointerUnchecked(_Address);
|
||||
memset(ptr, _iValue, _iLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
for (size_t i = 0; i < _iLength; i++)
|
||||
Write_U8(_iValue, (u32)(_Address + i));
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ std::string VertexShaderDesc(const ShaderID &id) {
|
||||
}
|
||||
|
||||
void ComputeVertexShaderID(ShaderID *id_out, u32 vertType, bool useHWTransform) {
|
||||
bool isModeThrough = gstate.isModeThrough();
|
||||
bool doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear();
|
||||
bool doTextureTransform = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
|
||||
bool doShadeMapping = doTexture && (gstate.getUVGenMode() == GE_TEXMAP_ENVIRONMENT_MAP);
|
||||
@@ -71,9 +72,8 @@ void ComputeVertexShaderID(ShaderID *id_out, u32 vertType, bool useHWTransform)
|
||||
bool hasColorTess = (gstate.vertType & GE_VTYPE_COL_MASK) != 0 && (doBezier || doSpline);
|
||||
bool hasTexcoordTess = (gstate.vertType & GE_VTYPE_TC_MASK) != 0 && (doBezier || doSpline);
|
||||
|
||||
bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough() && !gstate.isModeClear();
|
||||
bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled();
|
||||
// lmode: && !isModeThrough!?
|
||||
bool enableFog = gstate.isFogEnabled() && !isModeThrough && !gstate.isModeClear();
|
||||
bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled() && !isModeThrough;
|
||||
|
||||
ShaderID id;
|
||||
id.SetBit(VS_BIT_LMODE, lmode);
|
||||
|
||||
@@ -207,7 +207,6 @@ void SoftwareTransform(
|
||||
float uv[3] = {0, 0, 1};
|
||||
float fogCoef = 1.0f;
|
||||
|
||||
// We do software T&L for now
|
||||
float out[3];
|
||||
float pos[3];
|
||||
Vec3f normal(0, 0, 1);
|
||||
|
||||
@@ -930,7 +930,7 @@ std::string ShaderManagerGLES::DebugGetShaderString(std::string id, DebugShaderT
|
||||
// as sometimes these features might have an effect on the ID bits.
|
||||
|
||||
#define CACHE_HEADER_MAGIC 0x83277592
|
||||
#define CACHE_VERSION 4
|
||||
#define CACHE_VERSION 5
|
||||
struct CacheHeader {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
|
||||
@@ -112,7 +112,7 @@ void GenerateVertexShader(const ShaderID &id, char *buffer, uint32_t *attrMask,
|
||||
bool highpTexcoord = false;
|
||||
|
||||
if (gl_extensions.IsGLES) {
|
||||
if (gstate_c.featureFlags & GPU_SUPPORTS_GLSL_ES_300) {
|
||||
if (gstate_c.Supports(GPU_SUPPORTS_GLSL_ES_300)) {
|
||||
WRITE(p, "#version 300 es\n");
|
||||
glslES30 = true;
|
||||
texelFetch = "texelFetch";
|
||||
|
||||
@@ -594,8 +594,8 @@ void VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(const VKRStep &step
|
||||
w = vulkan_->GetBackbufferWidth();
|
||||
h = vulkan_->GetBackbufferHeight();
|
||||
renderPass = GetBackbufferRenderPass();
|
||||
assert(step.render.color == VKRRenderPassAction::CLEAR || step.render.color == VKRRenderPassAction::DONT_CARE);
|
||||
assert(step.render.depthStencil == VKRRenderPassAction::CLEAR || step.render.depthStencil == VKRRenderPassAction::DONT_CARE);
|
||||
_dbg_assert_msg_(G3D, step.render.color == VKRRenderPassAction::CLEAR || step.render.color == VKRRenderPassAction::DONT_CARE, "Backbuffer pass should only be CLEAR or DONT_CARE");
|
||||
_dbg_assert_msg_(G3D, step.render.depthStencil == VKRRenderPassAction::CLEAR || step.render.depthStencil == VKRRenderPassAction::DONT_CARE, "Backbuffer pass should only be CLEAR or DONT_CARE");
|
||||
Uint8x4ToFloat4(clearVal[0].color.float32, step.render.clearColor);
|
||||
numClearVals = 2; // We don't bother with a depth buffer here.
|
||||
clearVal[1].depthStencil.depth = 0.0f;
|
||||
|
||||
Reference in new issue
Block a user